Geometry functions
Methods
-
<static> isPointInsideOrNearCircle(point, centerPoint, radius)
-
Checks if point is located near or inside the circle.
Parameters:
Name Type Description point
StockChartX.Point The point. centerPoint
StockChartX.Point The center point of circle. radius
number | StockChartX.Point The radius of circle or the point to calculate radius. Returns:
- Type
- boolean
-
<static> isPointInsideOrNearRect(point, rect)
-
Checks if point is located near or inside of a given rectangle.
Parameters:
Name Type Description point
StockChartX.Point The point. rect
StockChartX.IRect The rectangle. Returns:
- Type
- boolean
-
<static> isPointInsideOrNearRectPoints(point, rectPoint1, rectPoint2)
-
Checks if point is located near or inside of a given rectangle described by 2 points.
Parameters:
Name Type Description point
StockChartX.Point The point. rectPoint1
StockChartX.Point The first point of rectangle. rectPoint2
StockChartX.Point The second point of rectangle. Returns:
- Type
- boolean
-
<static> isPointNearCircle(point, centerPoint, radius)
-
Checks if point is located near the circle.
Parameters:
Name Type Description point
StockChartX.Point The point. centerPoint
StockChartX.Point The center point of circle. radius
number | StockChartX.Point The radius of circle or the point to calculate radius. Returns:
- Type
- boolean
-
<static> isPointNearEllipse(point, centerPoint, radiusPoint)
-
Checks if point is located near the ellipse.
Parameters:
Name Type Description point
StockChartX.Point The check point. centerPoint
StockChartX.Point The center point of ellipse. radiusPoint
StockChartX.Point The point to calculate horizontal and vertical radius of ellipse. Returns:
- Type
- boolean
-
<static> isPointNearEllipseWithRadiuses(point, centerPoint, horRadius, verRadius)
-
Checks if point is located near the ellipse.
Parameters:
Name Type Description point
StockChartX.Point The check point. centerPoint
StockChartX.Point The center point of ellipse. horRadius
number The horizontal radius of ellipse. verRadius
number The vertical radius of ellipse. Returns:
- Type
- boolean
-
<static> isPointNearLine(point, linePoint1, linePoint2)
-
Checks if point is located near the line.
Parameters:
Name Type Description point
StockChartX.Point The check point. linePoint1
StockChartX.Point The first point of line. linePoint2
StockChartX.Point The second point of line. Returns:
- Type
- boolean
-
<static> isPointNearPoint(point, checkPoint)
-
Checks if one point is located near other point.
Parameters:
Name Type Description point
StockChartX.Point The first point. checkPoint
StockChartX.Point | Array.<StockChartX.Point> The second point or an array of points. Returns:
- Type
- boolean
-
<static> isPointNearPolygon(point, polygonPoints)
-
Checks if point is located near the polygon.
Parameters:
Name Type Description point
StockChartX.Point The point. polygonPoints
Array.<StockChartX.Point> The polygon points. Returns:
- Type
- boolean
-
<static> isPointNearPolyline(point, polylinePoints)
-
Checks if point is located near the line.
Parameters:
Name Type Description point
StockChartX.Point The check point. polylinePoints
Array.<StockChartX.Point> The array of points. Returns:
- Type
- boolean
-
<static> isPointNearRectPoints(point, rectPoint1, rectPoint2)
-
Checks if point is located near rectangle described by 2 points.
Parameters:
Name Type Description point
StockChartX.Point The point. rectPoint1
StockChartX.Point The first point of rectangle. rectPoint2
StockChartX.Point The second point of rectangle. Returns:
- Type
- boolean
-
<static> isValueBetweenOrNearValues(value, value1, value2)
-
Checks if value is located between two values (with deviation).
Parameters:
Name Type Description value
Number The value to check. value1
Number The first value. value2
Number The second value. Returns:
- Type
- boolean
-
<static> isValueNearValue(value1, value2)
-
Checks if two values are equal or their difference is not greater than deviation.
Parameters:
Name Type Description value1
Number The first value. value2
Number The second value. Returns:
- Type
- boolean
-
<static> length(point1, point2)
-
Calculates line length.
Parameters:
Name Type Description point1
StockChartX.Point The first point. point2
StockChartX.Point The second point. Returns:
The length of line.- Type
- Number
-
<static> xProjectionLength(point1, point2)
-
Calculates X projection length.
Parameters:
Name Type Description point1
StockChartX.Point The first point. point2
StockChartX.Point The second point. Returns:
The length of X projection.- Type
- Number
-
<static> yProjectionLength(point1, point2)
-
Calculates Y projection length.
Parameters:
Name Type Description point1
StockChartX.Point The first point. point2
StockChartX.Point The second point. Returns:
The length of Y projection.- Type
- Number