Documentation ¶
Index ¶
- Variables
- func DegreeToRadian[T types.Numbers](angle T) T
- func RadianToDegree[T types.Numbers](angle T) T
- type Angle
- type AngleDirection
- func (t AngleDirection) MarshalJSON() ([]byte, error)
- func (t AngleDirection) MarshalYAML() (interface{}, error)
- func (t *AngleDirection) Scan(value interface{}) error
- func (t AngleDirection) String() string
- func (t *AngleDirection) UnmarshalJSON(data []byte) error
- func (t *AngleDirection) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (t AngleDirection) Value() (driver.Value, error)
- type AngleType
- func (t AngleType) MarshalJSON() ([]byte, error)
- func (t AngleType) MarshalYAML() (interface{}, error)
- func (t *AngleType) Scan(value interface{}) error
- func (t AngleType) String() string
- func (t *AngleType) UnmarshalJSON(data []byte) error
- func (t *AngleType) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (t AngleType) Value() (driver.Value, error)
- type CartesianCoordinate
- type Circle
- type Dimension2d
- type LineSegment
- func (t LineSegment[T]) IntersectAt(segment LineSegment[T]) CartesianCoordinate[T]
- func (t LineSegment[T]) Length() T
- func (t LineSegment[T]) Midpoint() CartesianCoordinate[T]
- func (t LineSegment[T]) PointAtPercent(percentage T) CartesianCoordinate[T]
- func (t LineSegment[T]) Slope() T
- func (t LineSegment[T]) SlopeIntercept() SlopeInterceptLine[T]
- func (t LineSegment[T]) Standard() StandardLine[T]
- type PolarCoordinate
- type Rectangle
- func (t Rectangle[T]) Area() T
- func (t Rectangle[T]) BottomLeft() CartesianCoordinate[T]
- func (t Rectangle[T]) BottomMidpoint() CartesianCoordinate[T]
- func (t Rectangle[T]) BottomRight() CartesianCoordinate[T]
- func (t Rectangle[T]) Center() CartesianCoordinate[T]
- func (t Rectangle[T]) LeftMidpoint() CartesianCoordinate[T]
- func (t Rectangle[T]) Perimeter() T
- func (t Rectangle[T]) PointOnPeremiter(angle Angle[T]) CartesianCoordinate[T]
- func (t Rectangle[T]) RightMidpoint() CartesianCoordinate[T]
- func (t Rectangle[T]) TopMidpoint() CartesianCoordinate[T]
- func (t Rectangle[T]) TopRight() CartesianCoordinate[T]
- type SlopeInterceptLine
- type StandardLine
Constants ¶
This section is empty.
Variables ¶
View Source
var AngleDirections = struct { angleDirections Err error Values []AngleDirection }{ Err: fmt.Errorf("invalid AngleDirection"), // contains filtered or unexported fields }
View Source
var AngleTypes = struct { angleTypes Err error Values []AngleType }{ Err: fmt.Errorf("invalid AngleType"), // contains filtered or unexported fields }
Functions ¶
func DegreeToRadian ¶
func RadianToDegree ¶
Types ¶
type Angle ¶
type Angle[T types.Numbers] struct { Magnitude T Type AngleType Direction AngleDirection }
type AngleDirection ¶
type AngleDirection string
func (AngleDirection) MarshalJSON ¶
func (t AngleDirection) MarshalJSON() ([]byte, error)
func (AngleDirection) MarshalYAML ¶
func (t AngleDirection) MarshalYAML() (interface{}, error)
func (*AngleDirection) Scan ¶
func (t *AngleDirection) Scan(value interface{}) error
func (AngleDirection) String ¶
func (t AngleDirection) String() string
func (*AngleDirection) UnmarshalJSON ¶
func (t *AngleDirection) UnmarshalJSON(data []byte) error
func (*AngleDirection) UnmarshalYAML ¶
func (t *AngleDirection) UnmarshalYAML(unmarshal func(interface{}) error) error
type AngleType ¶
type AngleType string
func (AngleType) MarshalJSON ¶
func (AngleType) MarshalYAML ¶
func (*AngleType) UnmarshalJSON ¶
func (*AngleType) UnmarshalYAML ¶
type CartesianCoordinate ¶
func PolarToCartesian ¶
func PolarToCartesian[T types.Numbers](coordinate PolarCoordinate[T]) CartesianCoordinate[T]
type Circle ¶
type Circle[T types.Numbers] struct { Center CartesianCoordinate[T] Radius T }
func NewCircleXY ¶
func (Circle[T]) PointOnCircumference ¶
func (t Circle[T]) PointOnCircumference(angle Angle[T]) CartesianCoordinate[T]
type Dimension2d ¶
func NewDimension2d ¶
func NewDimension2d[T types.Numbers](height, width T) Dimension2d[T]
type LineSegment ¶
type LineSegment[T types.Numbers] struct { Start CartesianCoordinate[T] End CartesianCoordinate[T] }
func NewLineSegmentCoords ¶
func NewLineSegmentCoords[T types.Numbers](start, end CartesianCoordinate[T]) LineSegment[T]
func NewLineSegmentXY ¶
func NewLineSegmentXY[T types.Numbers](x1, y1, x2, y2 T) LineSegment[T]
func (LineSegment[T]) IntersectAt ¶
func (t LineSegment[T]) IntersectAt(segment LineSegment[T]) CartesianCoordinate[T]
https://www.cuemath.com/geometry/intersection-of-two-lines/ https://www.cuemath.com/algebra/cross-multiplication-method/
func (LineSegment[T]) Length ¶
func (t LineSegment[T]) Length() T
func (LineSegment[T]) Midpoint ¶
func (t LineSegment[T]) Midpoint() CartesianCoordinate[T]
func (LineSegment[T]) PointAtPercent ¶
func (t LineSegment[T]) PointAtPercent(percentage T) CartesianCoordinate[T]
func (LineSegment[T]) Slope ¶
func (t LineSegment[T]) Slope() T
func (LineSegment[T]) SlopeIntercept ¶
func (t LineSegment[T]) SlopeIntercept() SlopeInterceptLine[T]
func (LineSegment[T]) Standard ¶
func (t LineSegment[T]) Standard() StandardLine[T]
type PolarCoordinate ¶
func CartesianToPolar ¶
func CartesianToPolar[T types.Numbers](coordinate CartesianCoordinate[T]) PolarCoordinate[T]
type Rectangle ¶
type Rectangle[T types.Numbers] struct { TopLeft CartesianCoordinate[T] Dimensions Dimension2d[T] }
func NewRectangle ¶
func NewRectangle[T types.Numbers](topLeft CartesianCoordinate[T], dimensions Dimension2d[T]) Rectangle[T]
func NewRectangleXYHW ¶
func (Rectangle[T]) BottomLeft ¶
func (t Rectangle[T]) BottomLeft() CartesianCoordinate[T]
func (Rectangle[T]) BottomMidpoint ¶
func (t Rectangle[T]) BottomMidpoint() CartesianCoordinate[T]
func (Rectangle[T]) BottomRight ¶
func (t Rectangle[T]) BottomRight() CartesianCoordinate[T]
func (Rectangle[T]) Center ¶
func (t Rectangle[T]) Center() CartesianCoordinate[T]
func (Rectangle[T]) LeftMidpoint ¶
func (t Rectangle[T]) LeftMidpoint() CartesianCoordinate[T]
func (Rectangle[T]) PointOnPeremiter ¶
func (t Rectangle[T]) PointOnPeremiter(angle Angle[T]) CartesianCoordinate[T]
func (Rectangle[T]) RightMidpoint ¶
func (t Rectangle[T]) RightMidpoint() CartesianCoordinate[T]
func (Rectangle[T]) TopMidpoint ¶
func (t Rectangle[T]) TopMidpoint() CartesianCoordinate[T]
func (Rectangle[T]) TopRight ¶
func (t Rectangle[T]) TopRight() CartesianCoordinate[T]
type SlopeInterceptLine ¶
func (SlopeInterceptLine[T]) Segment ¶
func (t SlopeInterceptLine[T]) Segment(x1, x2 T) LineSegment[T]
func (SlopeInterceptLine[T]) Y ¶
func (t SlopeInterceptLine[T]) Y(x T) T
type StandardLine ¶
Click to show internal directories.
Click to hide internal directories.