Class LineGeneral2D_F64

java.lang.Object
georegression.struct.line.LineGeneral2D_F64
All Implemented Interfaces:
Serializable

public class LineGeneral2D_F64 extends Object implements Serializable

Represents the line using three parameters such that any point on the line obeys the following formula, A*x + B*y + C = 0. Any 2D line can be represented using this notation. This formulation is also known as standard and implicit. The slope is -A/B.

If it is said the line is normalized that refers to it being scaled such that A*A + B*B = 1. To normalize a line call normalize(). After normalization several operations become less expensive.

See Also:
  • Field Details

    • A

      public double A
      Coefficients which define the line.
    • B

      public double B
      Coefficients which define the line.
    • C

      public double C
      Coefficients which define the line.
  • Constructor Details

    • LineGeneral2D_F64

      public LineGeneral2D_F64(double a, double b, double c)
      A*x + B*y + C = 0
      Parameters:
      a - parameter A
      b - parameter B
      c - parameter C
    • LineGeneral2D_F64

      public LineGeneral2D_F64(LineGeneral2D_F64 line)
    • LineGeneral2D_F64

      public LineGeneral2D_F64()
  • Method Details

    • setTo

      public LineGeneral2D_F64 setTo(LineGeneral2D_F64 original)
    • setTo

      public LineGeneral2D_F64 setTo(double a, double b, double c)
      A*x + B*y + C = 0
      Parameters:
      a - parameter A
      b - parameter B
      c - parameter C
    • zero

      public void zero()
    • normalize

      public void normalize()
      Ensures that A*A + B*B == 1
    • evaluate

      public double evaluate(double x, double y)
      Returns the result of A*x + B*y + C. If the line is normalized then this is also the signed distance away from the line.
      Parameters:
      x - x-coordinate of a point
      y - y-coordinate of a point
      Returns:
      result of line equation
    • evaluate

      public double evaluate(double x, double y, double z)
    • copy

      public LineGeneral2D_F64 copy()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object