Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace geom

Index

Variables

Let F

F: Floats = Floats

Let L

L: Line = Line

Let M

M: Math = Math

Let N

N: Numbers = Numbers

Let P

P: Point2 = Point2

Let R

R: Radians = Radians

Let S

S: Segment = Segment

Let V

V: Vector2 = Vector2

Functions

Let inDiagonalRect

  • Returns an indicator of where the specified point {@code (px,py)} lies with respect to the line segment from {@code (x1,y1)} to {@code (x2,y2)}. The return value can be either 1, -1, or 0 and indicates in which direction the specified line must pivot around its first end point, {@code (x1,y1)}, in order to point at the specified point {@code (px,py)}.

    A return value of 1 indicates that the line segment must turn in the direction that takes the positive X axis towards the negative Y axis. In the default coordinate system used by Java 2D, this direction is counterclockwise.

    A return value of -1 indicates that the line segment must turn in the direction that takes the positive X axis towards the positive Y axis. In the default coordinate system, this direction is clockwise.

    A return value of 0 indicates that the point lies exactly on the line segment. Note that an indicator value of 0 is rare and not useful for determining collinearity because of floating point rounding issues.

    If the point is colinear with the line segment, but not between the end points, then the value will be -1 if the point lies "beyond {@code (x1,y1)}" or 1 if the point lies "beyond {@code (x2,y2)}".

    Parameters

    Returns boolean

    an integer that indicates the position of the third specified coordinates with respect to the line segment formed by the first two specified coordinates.

Let relativeCCW

  • relativeCCW(x1: number, y1: number, x2: number, y2: number, px: number, py: number): 0 | 1 | -1
  • Returns an indicator of where the specified point {@code (px,py)} lies with respect to the line segment from {@code (x1,y1)} to {@code (x2,y2)}. The return value can be either 1, -1, or 0 and indicates in which direction the specified line must pivot around its first end point, {@code (x1,y1)}, in order to point at the specified point {@code (px,py)}.

    A return value of 1 indicates that the line segment must turn in the direction that takes the positive X axis towards the negative Y axis. In the default coordinate system used by Java 2D, this direction is counterclockwise.

    A return value of -1 indicates that the line segment must turn in the direction that takes the positive X axis towards the positive Y axis. In the default coordinate system, this direction is clockwise.

    A return value of 0 indicates that the point lies exactly on the line segment. Note that an indicator value of 0 is rare and not useful for determining collinearity because of floating point rounding issues.

    If the point is colinear with the line segment, but not between the end points, then the value will be -1 if the point lies "beyond {@code (x1,y1)}" or 1 if the point lies "beyond {@code (x2,y2)}".

    Parameters

    • x1: number

      the X coordinate of the start point of the specified line segment

    • y1: number

      the Y coordinate of the start point of the specified line segment

    • x2: number

      the X coordinate of the end point of the specified line segment

    • y2: number

      the Y coordinate of the end point of the specified line segment

    • px: number

      the X coordinate of the specified point to be compared with the specified line segment

    • py: number

      the Y coordinate of the specified point to be compared with the specified line segment

    Returns 0 | 1 | -1

    an integer that indicates the position of the third specified coordinates with respect to the line segment formed by the first two specified coordinates.