Skip to main content
Version: Version 5 beta

Class: Point

Represents a point in a two-dimensional coordinate system.

Implements

Constructors

Constructor

new Point(x?, y?): Point

Creates a new Point instance with the specified coordinates.

Parameters

x?

number = 0

The X value (horizontal coordinate).

y?

number = 0

The Y value (vertical coordinate).

Returns

Point

Properties

x

x: number

The X value (horizontal coordinate).


y

y: number

The Y value (vertical coordinate).

Methods

clone()

clone(): Point

Creates a deep copy of the object.

Returns

Point

A new instance that is a deep copy of the original object.

Implementation of

Cloneable.clone


calculateCentroid()

static calculateCentroid(points): Point

Parameters

points

Point[]

Returns

Point


calculateNormalLineYIntercept()

static calculateNormalLineYIntercept(point, normalSlope): number

Parameters

point

Point

normalSlope

number

Returns

number


calculatePerpendicularIntersection()

static calculatePerpendicularIntersection(p1, p2, p3): Point

Parameters

p1

Point

p2

Point

p3

Point

Returns

Point


calculateSlope()

static calculateSlope(p1, p2): number

Parameters

p1

Point

p2

Point

Returns

number


calculateYIntercept()

static calculateYIntercept(point, slope): number

Parameters

point

Point

slope

number

Returns

number


findIntersection()

static findIntersection(slope1, yIntercept1, slope2, yIntercept2): Point

Parameters

slope1

number

yIntercept1

number

slope2

number

yIntercept2

number

Returns

Point