georegression.struct.line
Class LineGeneral2D_F32
- java.lang.Object
-
- georegression.struct.line.LineGeneral2D_F32
-
- All Implemented Interfaces:
- java.io.Serializable
public class LineGeneral2D_F32 extends java.lang.Object implements java.io.SerializableRepresents 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description floatACoefficients which define the line.floatBCoefficients which define the line.floatCCoefficients which define the line.
-
Constructor Summary
Constructors Constructor and Description LineGeneral2D_F32()LineGeneral2D_F32(float a, float b, float c)LineGeneral2D_F32(LineGeneral2D_F32 line)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description LineGeneral2D_F32copy()floatevaluate(float x, float y)Returns the result of A*x + B*y + C.floatgetA()floatgetB()floatgetC()voidnormalize()Ensures that A*A + B*B == 1voidset(float a, float b, float c)voidset(LineGeneral2D_F32 original)voidsetA(float a)voidsetB(float b)voidsetC(float c)java.lang.StringtoString()
-
-
-
Field Detail
-
A
public float A
Coefficients which define the line.
-
B
public float B
Coefficients which define the line.
-
C
public float C
Coefficients which define the line.
-
-
Constructor Detail
-
LineGeneral2D_F32
public LineGeneral2D_F32(float a, float b, float c)
-
LineGeneral2D_F32
public LineGeneral2D_F32(LineGeneral2D_F32 line)
-
LineGeneral2D_F32
public LineGeneral2D_F32()
-
-
Method Detail
-
getA
public float getA()
-
getB
public float getB()
-
getC
public float getC()
-
set
public void set(LineGeneral2D_F32 original)
-
set
public void set(float a, float b, float c)
-
setA
public void setA(float a)
-
setB
public void setB(float b)
-
setC
public void setC(float c)
-
normalize
public void normalize()
Ensures that A*A + B*B == 1
-
evaluate
public float evaluate(float x, float 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 pointy- y-coordinate of a point- Returns:
- result of line equation
-
copy
public LineGeneral2D_F32 copy()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG