geome v0.2.0
geome v0.2.0
Types
Circle
Circle =
object
Defined in: Circle.ts:7
A circle represented as a tuple of a center and a radius.
Properties
center
readonly
center:vec2
Defined in: Circle.ts:7
radius
readonly
radius:number
Defined in: Circle.ts:7
Line
Line =
object
Defined in: Line.ts:8
A line represented by the angle of its normal vector (in degrees) and the signed distance from the origin. Lines have direction, so two lines with opposite directions are considered different.
Properties
offset
readonly
offset:number
Defined in: Line.ts:12
The signed distance from the origin
theta
readonly
theta:number
Defined in: Line.ts:10
The angle of the normal vector in degrees (should be normalized to 0-360)
Range
Range = readonly [
number
,number
]
Defined in: Range.ts:5
A range of numbers. It must be guaranteed that min <= max
.
Rect
Rect = readonly [
vec2
,vec2
]
Defined in: Rect.ts:7
A 2D rect represented as a tuple of two diagonal points. It must be guaranteed that the first point is the minimum and the second one is the maximum in the x and y axes.
Segment
Segment = [
vec2
,vec2
]
Defined in: Segment.ts:9
A segment defined by two points. It distinguishes the order of the points.
Utilities
normalizeAngle()
normalizeAngle(
deg
):number
Defined in: utils.ts:9
EN: Normalize the angle to the range of -180 < angle <= 180.
Parameters
Parameter | Type | Description |
---|---|---|
deg | number | The angle to normalize in degrees |
Returns
number
The normalized angle in degrees