Class: Point
Represents a point in a two-dimensional coordinate system.
Implements
Cloneable<Point>
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
calculateCentroid()
staticcalculateCentroid(points):Point
Parameters
points
Point[]
Returns
Point
calculateNormalLineYIntercept()
staticcalculateNormalLineYIntercept(point,normalSlope):number
Parameters
point
Point
normalSlope
number
Returns
number
calculatePerpendicularIntersection()
staticcalculatePerpendicularIntersection(p1,p2,p3):Point
Parameters
p1
Point
p2
Point
p3
Point
Returns
Point
calculateSlope()
staticcalculateSlope(p1,p2):number
Parameters
p1
Point
p2
Point
Returns
number
calculateYIntercept()
staticcalculateYIntercept(point,slope):number
Parameters
point
Point
slope
number
Returns
number
findIntersection()
staticfindIntersection(slope1,yIntercept1,slope2,yIntercept2):Point
Parameters
slope1
number
yIntercept1
number
slope2
number
yIntercept2
number
Returns
Point