Documentation ¶
Index ¶
- Constants
- func ToDegrees(radians float64) float64
- func ToRadians(degrees float64) float64
- type Vec2
- func (v Vec2) Add(other Vec2) Vec2
- func (v Vec2) Angle(other Vec2) float64
- func (v Vec2) Distance(other Vec2) float64
- func (v Vec2) DivScalar(scalar float64) Vec2
- func (v Vec2) Dot(other *Vec2) float64
- func (v Vec2) Equal(other Vec2) bool
- func (v Vec2) IsZero() bool
- func (v Vec2) Magnitude() float64
- func (v Vec2) Mul(other Vec2) Vec2
- func (v Vec2) MulScalar(scalar float64) Vec2
- func (v Vec2) Normalized() Vec2
- func (v Vec2) Rotate(rad float64) Vec2
- func (v Vec2) RotateAround(point *Vec2, angle float64) Vec2
- func (v Vec2) Sub(other Vec2) Vec2
- func (v Vec2) XY() (float64, float64)
Constants ¶
View Source
const Epsilon = 0.00001
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Vec2 ¶
Vec2 represents a 2D vector.
func (Vec2) Normalized ¶ added in v1.2.20
Normalized returns the normalized vector.
func (Vec2) RotateAround ¶
RotateAround rotates the vector by the given angle around the given point.
Click to show internal directories.
Click to hide internal directories.