- type Metre = Float
- type Length = Metre
- type XPos = Metre
- type YPos = Metre
- type ZPos = Metre
- data Position = Position {}
- data Position3D = Position3D {}
- coordinates :: Position3D -> (XPos, YPos, ZPos)
- type XRadius = Metre
- type YRadius = Metre
- type ZRadius = Metre
- inRadiusOfPosition :: Position3D -> XRadius -> YRadius -> ZRadius -> Position -> Bool
- type Angle = Radian
- type Radian = Float
- angleHowFarFromPi :: Angle -> Angle
- angleHowFarFromAngle :: Angle -> Angle -> Angle
- movePoint :: RVector -> Position -> Position
- movePoint3D :: RVector3D -> Position3D -> Position3D
- pointToRectangle :: (Position, Position) -> Position -> Position
- pointInRectangle :: (Position, Position) -> Position -> Bool
- inCircleRadiusOfPosition :: Position3D -> XRadius -> ZRadius -> Position -> Bool
- data RVector = RVector {}
- data RVector3D = RVector3D {}
- data Speed = Speed {}
- data Speed3D = Speed3D {}
- type Velocity = Float
- class ToSpeed a where
- class FromSpeed a where
- class ToSpeed3D a where
- class FromSpeed3D a where
- fromSpeed3D :: Speed3D -> a
- class ToRVector a where
- class ToPosition a where
- toPosition :: a -> Position
- class FromPosition a where
- fromPosition :: Position -> a
- class ToPosition3D a where
- toPosition3D :: a -> Position3D
- class FromPosition3D a where
- fromPosition3D :: Position3D -> a
- type Degrees = Int
- scaleVector :: Float -> RVector -> RVector
- scaleVector3D :: Float -> RVector3D -> RVector3D
- fromRadian :: Radian -> Degrees
- toRadian :: Degrees -> Radian
- betweenPoints :: (Position, Position) -> Position -> Bool
- sizeVector :: RVector -> Float
- sizeVector3D :: RVector3D -> Float
- class Dist a b where
- orthogonal :: Angle -> (Angle, Angle)
- oppositeAngle :: Angle -> Angle
- angleWithObject :: Position -> Position -> Angle
- angleWithObjectForRun :: (Position, Angle) -> Position -> Angle
Documentation
coordinates :: Position3D -> (XPos, YPos, ZPos)Source
inRadiusOfPosition :: Position3D -> XRadius -> YRadius -> ZRadius -> Position -> BoolSource
angleHowFarFromAngle :: Angle -> Angle -> AngleSource
movePoint3D :: RVector3D -> Position3D -> Position3DSource
pointToRectangle :: (Position, Position) -> Position -> PositionSource
pointToRectangle (a,b) c
returns c
if pointInRectangle (a,b) c
and the
| projected point c'
of c
that is exactly on the closest edge of rectangle
| (a,b)
.
pointInRectangle :: (Position, Position) -> Position -> BoolSource
pointInRectangle (a,b) c
| returns True
iff point c
is inside the rectangle determined by
| the diagonal corner points a
and b
.
inCircleRadiusOfPosition :: Position3D -> XRadius -> ZRadius -> Position -> BoolSource
speed of an object
speed of an object in space
class ToPosition a whereSource
toPosition :: a -> PositionSource
class FromPosition a whereSource
fromPosition :: Position -> aSource
class ToPosition3D a whereSource
toPosition3D :: a -> Position3DSource
class FromPosition3D a whereSource
fromPosition3D :: Position3D -> aSource
scaleVector :: Float -> RVector -> RVectorSource
scaleVector k {dx,dy}
returns {k*dx,k*dy}
| scaleVector3D k {dxy,dz}
returns {scaleVector k dxy,k*dz}
scaleVector3D :: Float -> RVector3D -> RVector3DSource
fromRadian :: Radian -> DegreesSource
betweenPoints :: (Position, Position) -> Position -> BoolSource
betweenPoints (a,b) c
returns True iff c is on the line between a and b.
sizeVector :: RVector -> FloatSource
sizeVector {dx,dy} = sqrt (dx**2 + dy**2)
| sizeVector3D {dxy,dz} = sqrt ((dx dxy)**2 + (dy dxy)**2 + dz**2)
sizeVector3D :: RVector3D -> FloatSource
orthogonal :: Angle -> (Angle, Angle)Source
orthogonal a
returns the left- and right- orthogonal angles to a
oppositeAngle :: Angle -> AngleSource
angleWithObject :: Position -> Position -> AngleSource