Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AngleVector ¶
type AngleVector struct { // Direction is the direction of motion. Direction RadianAngle // Magnitude is the multiplier to determine distance traveled in one unit of // time. Magnitude float64 }
AngleVector = Magnitude * Direction
func (AngleVector) LinearVelocity ¶
func (v AngleVector) LinearVelocity() (xVel, yVel float64)
LinearVelocity returns a vector's velocity in both the x and y directions.
type Coordinate ¶
type Coordinate [2]float64
Coordinate represents the (x, y) coordinates on a grid. These coordinates represent points in space that may not actually be displayed in the grid.
func (Coordinate) Move ¶
func (c Coordinate) Move(v AngleVector) Coordinate
Move returns the next coordinate given an angle vector.
func (Coordinate) ToDiscreteCoordinate ¶
func (c Coordinate) ToDiscreteCoordinate() DiscreteCoord
ToDiscreteCoordinate rounds an imaginary coordinate to a discrete coordinate.
type DegreeAngle ¶
type DegreeAngle float64
DegreeAngle is an angle in degrees
func (DegreeAngle) ToRadians ¶
func (d DegreeAngle) ToRadians() (rad RadianAngle)
ToRadians converts degrees to radians
type DiscreteCoord ¶
type DiscreteCoord [2]int64
DiscreteCoord represents whole number (x, y) coordinates on a grid. These are coordinates where something can be displayed.
Click to show internal directories.
Click to hide internal directories.