geome v0.4.0
geome v0.4.0
Types
Circle
Circle =
object
Defined in: Circle.ts:7
A circle represented as a tuple of a center and a radius.
Properties
center
readonlycenter:vec2
Defined in: Circle.ts:7
radius
readonlyradius: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
readonlyoffset:number
Defined in: Line.ts:12
The signed distance from the origin
theta
readonlytheta: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.
Ray
Ray =
object
Defined in: Ray.ts:11
A ray represented by the point it starts from and the angle it goes at (in degrees, 0 = x+). Unlike Line, a ray has an origin, so two rays on the same line from different points are different.
Properties
angle
readonlyangle:number
Defined in: Ray.ts:15
The angle of the direction in degrees (should be normalized to 0-360)
origin
readonlyorigin:vec2
Defined in: Ray.ts:13
The point the ray starts from
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:7
A segment defined by two points. It distinguishes the order of the points.
SegmentIntersection
SegmentIntersection =
object
Defined in: Segment.ts:13
An intersection of two segments.
Properties
overlap?
readonlyoptionaloverlap:boolean
Defined in: Segment.ts:21
True when the point bounds a stretch on which both segments coincide
point
readonlypoint:vec2
Defined in: Segment.ts:19
The intersection point
t1
readonlyt1:number
Defined in: Segment.ts:15
The parameter on the first segment, in [0, 1]
t2
readonlyt2:number
Defined in: Segment.ts:17
The parameter on the second segment, in [0, 1]
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