Add airlocks
This commit is contained in:
@@ -461,6 +461,29 @@ divideCircle x cen rad = map (cen +.+) $ nRaysRad n rad
|
||||
where
|
||||
n = ceiling $ rad * 2 * pi / x
|
||||
|
||||
arcStepwise
|
||||
:: Float -- ^ Maximum distance between points
|
||||
-> Float -- ^ Angle to travel
|
||||
-> Point2 -- ^ Center
|
||||
-> Point2 -- ^ Start vector from center
|
||||
-> [Point2]
|
||||
arcStepwise ssize a c v
|
||||
| a < 0 = reverse $ arcStepwisePositive ssize (negate a) c (rotateV a v)
|
||||
| otherwise = arcStepwisePositive ssize a c v
|
||||
|
||||
arcStepwisePositive
|
||||
:: Float -- ^ Maximum distance between points
|
||||
-> Float -- ^ Angle to travel, assumed to be positive
|
||||
-> Point2 -- ^ Center
|
||||
-> Point2 -- ^ Start vector from center
|
||||
-> [Point2]
|
||||
arcStepwisePositive ssize a cen v = ((cen +.+) . (\rot -> rotateV rot v) ) <$> rots
|
||||
where
|
||||
rots :: [Float]
|
||||
rots = map ((a*) . (/ fromIntegral n ) . fromIntegral) [0 .. n]
|
||||
n :: Int
|
||||
n = ceiling (a * magV v / ssize)
|
||||
|
||||
--nPointsOnCirc :: Int -> Float -> [Point2]
|
||||
--nPointsOnCirc n rad = take n $ iterate (rotateV (2*pi/fromIntegral n)) (rad,0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user