class Geometry · Computations

Symbols

Creates symbol shapes centered on a point: circle, square, rectangle, diamond and triangle.

Static methods

circlestatic

static circle(center: Point | VectorLike, radius: Real | NumberLike, result?: Circle | null): Circle

Creates a circle centered at the specified point.

center
The center point of the circle.
radius
The radius of the circle.
result optional
Optional circle to store the result; if null, a new circle is created.

Returns A circle centered at the specified point.

diamondstatic

static diamond(center: Point | VectorLike, radius: Real | NumberLike, result?: Rectangle | null): Rectangle

Creates a diamond shape centered at the specified point.

center
The center point of the diamond.
radius
The distance from the center to each vertex of the diamond.
result optional
Optional rectangle to store the result; if null, a new rectangle is created.

Returns A diamond-shaped rectangle.

rectanglestatic

static rectangle(center: Point | VectorLike, width: Real | NumberLike, height: Real | NumberLike, result?: Rectangle | null): Rectangle

Creates an axis-aligned rectangle centered at the specified point.

center
The center point of the rectangle.
width
The width of the rectangle.
height
The height of the rectangle.
result optional
Optional rectangle to store the result; if null, a new rectangle is created.

Returns A rectangle centered at the specified point.

squarestatic

static square(center: Point | VectorLike, sideLength: Real | NumberLike, result?: Rectangle | null): Rectangle

Creates a square centered at the specified point.

center
The center point of the square.
sideLength
The length of each side of the square.
result optional
Optional rectangle to store the result; if null, a new rectangle is created.

Returns A square centered at the specified point.

trianglestatic

static triangle(center: Point | VectorLike, sideLength: Real | NumberLike, orientation: string, result?: Triangle | null): Triangle

Creates an equilateral triangle centered at the specified point with a given orientation.

center
The center point of the triangle.
sideLength
The length of each side of the triangle.
orientation
The orientation of the triangle. Supported values are "up", "down", "left", and "right", in any case ("Up" works too).
result optional
Optional triangle to store the result; if null, a new triangle is created.

Returns An equilateral triangle with the specified orientation.