public class PointUtil
extends java.lang.Object
Constructor and Description |
---|
PointUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
arePointsOnSameLine(android.graphics.PointF pt1,
android.graphics.PointF pt2,
android.graphics.PointF pt3)
Checks if points lies on the same line
|
static void |
clipToBounds(android.graphics.PointF point,
int width,
int height)
Clip point to the bounds
|
static float |
distance(float x1,
float y1,
float x2,
float y2)
Calculates distance between two points
|
static float |
distance(android.graphics.PointF pt1,
android.graphics.PointF pt2)
Calculates distance between two points
|
static float |
distanceFromLine(float x,
float y,
float startX,
float startY,
float endX,
float endY)
Computes the distance from line to point
|
static float |
distanceFromLine(android.graphics.PointF pt,
android.graphics.PointF start,
android.graphics.PointF end)
Computes the distance from line to point
|
static float |
distanceFromLineSegment(float x,
float y,
float startX,
float startY,
float endX,
float endY)
Computes the distance from line to point
|
static float |
distanceFromLineSegment(android.graphics.PointF pt,
android.graphics.PointF start,
android.graphics.PointF end)
Computes the distance from line to point
|
static boolean |
isInBounds(float x,
float y,
float left,
float top,
float right,
float bottom)
Checks if point lies within bounds
|
static boolean |
isInBounds(float x,
float y,
android.graphics.RectF rect)
Checks if point lies within bounds
|
static boolean |
isInBounds(float x,
float y,
com.scichart.core.common.Size viewportSize)
Checks if point lies within bounds
|
static boolean |
isInBounds(android.graphics.PointF point,
com.scichart.core.common.Size viewportSize)
Checks if point lies within bounds
|
static boolean |
isPointInTriangle(android.graphics.PointF checkPt,
android.graphics.PointF pointA,
android.graphics.PointF pointB,
android.graphics.PointF pointC)
Checks if point lies within triangle
|
static boolean |
liesToTheLeft(android.graphics.PointF pointToCheck,
android.graphics.PointF start,
android.graphics.PointF end)
Checks if point lies to the left of the line
|
static boolean |
lineIntersection2D(android.graphics.PointF intersection,
android.graphics.PointF firstLineStart,
android.graphics.PointF firstLineEnd,
android.graphics.PointF secondLineStart,
android.graphics.PointF secondLineEnd)
Looks for the intersection point for the two lines passed in
|
static boolean |
lineSegmentsIntersection2D(android.graphics.PointF intersection,
android.graphics.PointF firstLineStart,
android.graphics.PointF firstLineEnd,
android.graphics.PointF secondLineStart,
android.graphics.PointF secondLineEnd)
Looks for the intersection point for the two lines passed in
|
public static boolean lineSegmentsIntersection2D(android.graphics.PointF intersection, android.graphics.PointF firstLineStart, android.graphics.PointF firstLineEnd, android.graphics.PointF secondLineStart, android.graphics.PointF secondLineEnd)
intersection
- If the lines intersect, holds the intersection pointfirstLineStart
- The start point of the first linefirstLineEnd
- The end point of the first linesecondLineStart
- The start point of the second linesecondLineEnd
- The end point of the second linepublic static boolean lineIntersection2D(android.graphics.PointF intersection, android.graphics.PointF firstLineStart, android.graphics.PointF firstLineEnd, android.graphics.PointF secondLineStart, android.graphics.PointF secondLineEnd)
intersection
- If the lines intersect, holds the intersection pointfirstLineStart
- The start point of the first linefirstLineEnd
- The end point of the first linesecondLineStart
- The start point of the second linesecondLineEnd
- The end point of the second linepublic static float distance(android.graphics.PointF pt1, android.graphics.PointF pt2)
pt1
- The first pointpt2
- The second pointpublic static float distance(float x1, float y1, float x2, float y2)
x1
- The x-coordinate of the first pointy1
- The y-coordinate of the first pointx2
- The x-coordinate of the second pointy2
- The y-coordinate of the second pointpublic static float distanceFromLineSegment(android.graphics.PointF pt, android.graphics.PointF start, android.graphics.PointF end)
pt
- The point measure distance fromstart
- The line startend
- The line endpublic static float distanceFromLineSegment(float x, float y, float startX, float startY, float endX, float endY)
x
- The x-coordinate of the point to measure distance fromy
- The y-coordinate of the point to measure distance fromstartX
- The x-coordinate of the line startstartY
- The y-coordinate of the line startendX
- The x-coordinate of the line endendY
- The y-coordinate of the line endpublic static float distanceFromLine(android.graphics.PointF pt, android.graphics.PointF start, android.graphics.PointF end)
pt
- The point measure distance fromstart
- The line startend
- The line endpublic static float distanceFromLine(float x, float y, float startX, float startY, float endX, float endY)
x
- The x-coordinate of the point to measure distance fromy
- The y-coordinate of the point to measure distance fromstartX
- The x-coordinate of the line startstartY
- The y-coordinate of the line startendX
- The x-coordinate of the line endendY
- The y-coordinate of the line endpublic static boolean liesToTheLeft(android.graphics.PointF pointToCheck, android.graphics.PointF start, android.graphics.PointF end)
pointToCheck
- The point to checkstart
- The line startend
- The line endpublic static boolean isPointInTriangle(android.graphics.PointF checkPt, android.graphics.PointF pointA, android.graphics.PointF pointB, android.graphics.PointF pointC)
checkPt
- The point to checkpointA
- The first point of the trianglepointB
- The second point of the trianglepointC
- The third point of the trianglepublic static boolean isInBounds(android.graphics.PointF point, com.scichart.core.common.Size viewportSize)
point
- The point to checkviewportSize
- The boundspublic static boolean isInBounds(float x, float y, com.scichart.core.common.Size viewportSize)
x
- The x-coordinate of the point to checky
- The y-coordinate of the point to checkviewportSize
- The boundspublic static boolean isInBounds(float x, float y, android.graphics.RectF rect)
x
- The x-coordinate of the point to checky
- The y-coordinate of the point to checkrect
- The boundspublic static boolean isInBounds(float x, float y, float left, float top, float right, float bottom)
x
- The x-coordinate of the point to checky
- The y-coordinate of the point to checkleft
- The left boundstop
- The top boundsright
- The right boundsbottom
- The bottom boundspublic static boolean arePointsOnSameLine(android.graphics.PointF pt1, android.graphics.PointF pt2, android.graphics.PointF pt3)
pt1
- The first point to checkpt2
- The second point to checkpt3
- The third point to checkpublic static void clipToBounds(android.graphics.PointF point, int width, int height)
point
- The point to clipwidth
- The bounds widthheight
- The bounds height