Package wprover
Class Constraint
- java.lang.Object
-
- wprover.Constraint
-
public class Constraint extends java.lang.ObjectThe Constraint class represents a geometric constraint in a geometric construction. It contains methods to generate and manipulate constraints, as well as to calculate polynomial representations of the constraints.
-
-
Field Summary
Fields Modifier and Type Field Description static intALINEstatic intANGLE_BISECTORstatic intBARYCENTERstatic intBISECTstatic intBLINEstatic intCCLinestatic intCCTANGENTstatic intCCTANGENT_LINEstatic intCIRCLEstatic intCIRCLE3Pstatic intCIRCUMCENTERstatic intCOLLINEARstatic intCONSTANTstatic intEQ_TRIANLEstatic intEQANGLEstatic intEQANGLE3Pstatic intEQDISTANCEstatic intEQUIVALENCE1static intEQUIVALENCE2static intHORIZONALstatic intINCENTERstatic intINTER_CCstatic intINTER_CC1static intINTER_LCstatic intINTER_LLstatic intINVISIBLEstatic intISO_RIGHT_ANGLED_TRIANGLEstatic intISO_TRIANGLEstatic intLC_MEETstatic intLCTANGENTstatic intLINEstatic intLRATIOstatic intMIDPOINTstatic intMIRRORstatic intNETRIANGLEstatic intNRATIOstatic intNSQUAREstatic intNTANGLEstatic intNULLTYPEstatic intON_ABLINEstatic intONALINEstatic intONDCIRCLEstatic intONRCIRCLEstatic intONSCIRCLEstatic intORTHOCENTERstatic intP_O_Astatic intPARALLELstatic intPARALLELOGRAMstatic intPENTAGONstatic intPERPBISECTstatic intPERPENDICULARstatic intPETRIANGLEstatic intPFOOTstatic intPOLYGONstatic intPONCIRCLEstatic intPONLINEstatic intPRATIOstatic intPSQUAREstatic intPSYMstatic intQUADRANGLEstatic intRATIOstatic intRCIRCLEstatic intRECTANGLEstatic intRIGHT_ANGLE_TRAPEZOIDstatic intRIGHT_ANGLED_TRIANGLEstatic intSANGLEstatic intSPECIFIC_ANGELstatic intSQUAREstatic intSYMPOINTstatic intTCLINEstatic intTRANSFORMstatic intTRANSFORM1static intTRAPEZOIDstatic intTRATIOstatic intTRIANGLEstatic intVERTICALstatic intVISIBLE
-
Constructor Summary
Constructors Constructor Description Constraint(int id)Constructs a Constraint with the specified ID.Constraint(int type, java.lang.Object obj)Constructs a Constraint with a single element.Constraint(int type, java.lang.Object obj1, int prop)Constructs a Constraint with a single element and a proportion, and generates the polynomial if required.Constraint(int type, java.lang.Object obj1, java.lang.Object obj2)Constructs a Constraint with two elements and generates the polynomial if required.Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, boolean gpoly)Constructs a Constraint with two elements and optionally generates the polynomial.Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3)Constructs a Constraint with three elements and generates the polynomial if required.Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, int prop)Constructs a Constraint with three elements and a proportion, and generates the polynomial if required.Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4)Constructs a Constraint with four elements and generates the polynomial if required.Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, int prop)Constructs a Constraint with four elements and a proportion, and generates the polynomial if required.Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5)Constructs a Constraint with five elements and generates the polynomial if required.Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5, java.lang.Object obj6)Constructs a Constraint with six elements and generates the polynomial if required.Constraint(int type, java.util.Vector olist)Constructs a Constraint with a list of elements and generates the polynomial.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5)Adds a constraint description with five objects to the list of constraints.voidadd_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6)Adds a constraint description with six objects to the list of constraints.voidadd_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7)Adds a constraint description with seven objects to the list of constraints.voidadd_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7, java.lang.Object p8)Adds a constraint description with eight objects to the list of constraints.voidadd_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7, java.lang.Object p8, java.lang.Object p9, java.lang.Object p10)Adds a constraint description with ten objects to the list of constraints.voidadd_des(int t, java.util.Vector v)Adds a constraint description with a vector of points to the list of constraints.voidadd_des(int t, CPoint p1, CPoint p2, CPoint p3)Adds a constraint description with three points to the list of constraints.voidadd_des(int t, CPoint p1, CPoint p2, CPoint p3, java.lang.Object obj)Adds a constraint description with three points and an additional object to the list of constraints.voidadd_des(int t, CPoint p1, CPoint p2, CPoint p3, CPoint p4)Adds a constraint description with four points to the list of constraints.voidadd_desx1(int t, CPoint p1, CPoint p2, CPoint p3, CPoint p4)Adds a constraint description with four points to the list of constraints, ensuring the points are ordered by their x-index.voidaddelement(java.lang.Object obj)Adds an element to the element list if it is not null.voidaddElement(java.lang.Object obj)Adds an element to the element list.voidaddPoly(TPoly tp)Adds a polynomial to the polynomial list.booleanaddZeron(TMono m1)Adds a zero coefficient to the TMono object if its length is 1.voidcalculate(Param[] para)Calculates the polynomial representation using the given parameters.booleancheck_agbisector(double x, double y)Checks if the angle bisector constraint is satisfied for the given coordinates.booleancheck_constraint(double x, double y)Checks if the constraint is satisfied for the given coordinates.booleancheck_incenter(double x, double y)Checks if the incenter constraint is satisfied for the given coordinates.voidclear_all_cons()Clears all constraints by setting the constraint descriptors to null.booleancompareLN(CLine ln1, CLine ln2)Compares two lines based on the ID of their first points.doubledr_pr(double x1, double y1, double x2, double y2, double x, double y)Calculates the determinant of the given points.TMonoeqdistance(CPoint p1, CPoint p2, CPoint p3, CPoint p4)Creates a TMono object representing the equality of distances between two pairs of points.static doubleget_sp_ag_value(int v)Returns the special angle value for the given angle in degrees.java.util.VectorgetAllElements()Retrieves all elements in the element list.intGetConstraintType()Gets the type of the constraint.java.lang.Objectgetelement(int i)Retrieves an element from the element list at the specified index.static TPolygetPolyListAndSetNull()Retrieves the polynomial list and sets it to null.booleanless(CPoint a, CPoint b)Compares two points based on their x-index.voidLoad(java.io.DataInputStream in, DrawProcess dp)Loads the constraint data from a DataInputStream.TPolyNewTPoly(TMono m1, TMono m2)Creates a new TPoly object from two TMono objects.TMonoparseTMonoString(java.lang.String name, java.lang.String func, int x)Parses a TMono object from a string representation.voidSave(java.io.DataOutputStream out)Saves the constraint data to a DataOutputStream.voidsetPolyGenerate(boolean r)Sets whether the polynomial should be generated.java.lang.StringtoString()Returns the string representation of the constraint.
-
-
-
Field Detail
-
NULLTYPE
public static final int NULLTYPE
- See Also:
- Constant Field Values
-
PONLINE
public static final int PONLINE
- See Also:
- Constant Field Values
-
PONCIRCLE
public static final int PONCIRCLE
- See Also:
- Constant Field Values
-
PARALLEL
public static final int PARALLEL
- See Also:
- Constant Field Values
-
PERPENDICULAR
public static final int PERPENDICULAR
- See Also:
- Constant Field Values
-
PFOOT
public static final int PFOOT
- See Also:
- Constant Field Values
-
EQDISTANCE
public static final int EQDISTANCE
- See Also:
- Constant Field Values
-
COLLINEAR
public static final int COLLINEAR
- See Also:
- Constant Field Values
-
PERPBISECT
public static final int PERPBISECT
- See Also:
- Constant Field Values
-
MIDPOINT
public static final int MIDPOINT
- See Also:
- Constant Field Values
-
EQANGLE
public static final int EQANGLE
- See Also:
- Constant Field Values
-
LCTANGENT
public static final int LCTANGENT
- See Also:
- Constant Field Values
-
CCTANGENT
public static final int CCTANGENT
- See Also:
- Constant Field Values
-
LRATIO
public static final int LRATIO
- See Also:
- Constant Field Values
-
RCIRCLE
public static final int RCIRCLE
- See Also:
- Constant Field Values
-
CIRCUMCENTER
public static final int CIRCUMCENTER
- See Also:
- Constant Field Values
-
BARYCENTER
public static final int BARYCENTER
- See Also:
- Constant Field Values
-
ORTHOCENTER
public static final int ORTHOCENTER
- See Also:
- Constant Field Values
-
INCENTER
public static final int INCENTER
- See Also:
- Constant Field Values
-
BISECT
public static final int BISECT
- See Also:
- Constant Field Values
-
CCLine
public static final int CCLine
- See Also:
- Constant Field Values
-
TRATIO
public static final int TRATIO
- See Also:
- Constant Field Values
-
PRATIO
public static final int PRATIO
- See Also:
- Constant Field Values
-
MIRROR
public static final int MIRROR
- See Also:
- Constant Field Values
-
HORIZONAL
public static final int HORIZONAL
- See Also:
- Constant Field Values
-
VERTICAL
public static final int VERTICAL
- See Also:
- Constant Field Values
-
VISIBLE
public static final int VISIBLE
- See Also:
- Constant Field Values
-
INVISIBLE
public static final int INVISIBLE
- See Also:
- Constant Field Values
-
NRATIO
public static final int NRATIO
- See Also:
- Constant Field Values
-
LC_MEET
public static final int LC_MEET
- See Also:
- Constant Field Values
-
EQANGLE3P
public static final int EQANGLE3P
- See Also:
- Constant Field Values
-
SPECIFIC_ANGEL
public static final int SPECIFIC_ANGEL
- See Also:
- Constant Field Values
-
SYMPOINT
public static final int SYMPOINT
- See Also:
- Constant Field Values
-
P_O_A
public static final int P_O_A
- See Also:
- Constant Field Values
-
INTER_CC1
public static final int INTER_CC1
- See Also:
- Constant Field Values
-
PSQUARE
public static final int PSQUARE
- See Also:
- Constant Field Values
-
NSQUARE
public static final int NSQUARE
- See Also:
- Constant Field Values
-
NTANGLE
public static final int NTANGLE
- See Also:
- Constant Field Values
-
PETRIANGLE
public static final int PETRIANGLE
- See Also:
- Constant Field Values
-
NETRIANGLE
public static final int NETRIANGLE
- See Also:
- Constant Field Values
-
CONSTANT
public static final int CONSTANT
- See Also:
- Constant Field Values
-
SQUARE
public static final int SQUARE
- See Also:
- Constant Field Values
-
ALINE
public static final int ALINE
- See Also:
- Constant Field Values
-
PSYM
public static final int PSYM
- See Also:
- Constant Field Values
-
INTER_LL
public static final int INTER_LL
- See Also:
- Constant Field Values
-
INTER_LC
public static final int INTER_LC
- See Also:
- Constant Field Values
-
INTER_CC
public static final int INTER_CC
- See Also:
- Constant Field Values
-
TRIANGLE
public static final int TRIANGLE
- See Also:
- Constant Field Values
-
ISO_TRIANGLE
public static final int ISO_TRIANGLE
- See Also:
- Constant Field Values
-
EQ_TRIANLE
public static final int EQ_TRIANLE
- See Also:
- Constant Field Values
-
RIGHT_ANGLED_TRIANGLE
public static final int RIGHT_ANGLED_TRIANGLE
- See Also:
- Constant Field Values
-
ISO_RIGHT_ANGLED_TRIANGLE
public static final int ISO_RIGHT_ANGLED_TRIANGLE
- See Also:
- Constant Field Values
-
QUADRANGLE
public static final int QUADRANGLE
- See Also:
- Constant Field Values
-
PARALLELOGRAM
public static final int PARALLELOGRAM
- See Also:
- Constant Field Values
-
TRAPEZOID
public static final int TRAPEZOID
- See Also:
- Constant Field Values
-
RIGHT_ANGLE_TRAPEZOID
public static final int RIGHT_ANGLE_TRAPEZOID
- See Also:
- Constant Field Values
-
RECTANGLE
public static final int RECTANGLE
- See Also:
- Constant Field Values
-
PENTAGON
public static final int PENTAGON
- See Also:
- Constant Field Values
-
POLYGON
public static final int POLYGON
- See Also:
- Constant Field Values
-
SANGLE
public static final int SANGLE
- See Also:
- Constant Field Values
-
ANGLE_BISECTOR
public static final int ANGLE_BISECTOR
- See Also:
- Constant Field Values
-
BLINE
public static final int BLINE
- See Also:
- Constant Field Values
-
TCLINE
public static final int TCLINE
- See Also:
- Constant Field Values
-
RATIO
public static final int RATIO
- See Also:
- Constant Field Values
-
TRANSFORM
public static final int TRANSFORM
- See Also:
- Constant Field Values
-
EQUIVALENCE1
public static final int EQUIVALENCE1
- See Also:
- Constant Field Values
-
EQUIVALENCE2
public static final int EQUIVALENCE2
- See Also:
- Constant Field Values
-
TRANSFORM1
public static final int TRANSFORM1
- See Also:
- Constant Field Values
-
LINE
public static final int LINE
- See Also:
- Constant Field Values
-
CIRCLE
public static final int CIRCLE
- See Also:
- Constant Field Values
-
CIRCLE3P
public static final int CIRCLE3P
- See Also:
- Constant Field Values
-
CCTANGENT_LINE
public static final int CCTANGENT_LINE
- See Also:
- Constant Field Values
-
ONSCIRCLE
public static final int ONSCIRCLE
- See Also:
- Constant Field Values
-
ON_ABLINE
public static final int ON_ABLINE
- See Also:
- Constant Field Values
-
ONDCIRCLE
public static final int ONDCIRCLE
- See Also:
- Constant Field Values
-
ONRCIRCLE
public static final int ONRCIRCLE
- See Also:
- Constant Field Values
-
ONALINE
public static final int ONALINE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Constraint
public Constraint(int id)
Constructs a Constraint with the specified ID.- Parameters:
id- the ID of the constraint
-
Constraint
public Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, boolean gpoly)Constructs a Constraint with two elements and optionally generates the polynomial.- Parameters:
type- the type of the constraintobj1- the first elementobj2- the second elementgpoly- true if the polynomial should be generated, false otherwise
-
Constraint
public Constraint(int type, java.util.Vector olist)Constructs a Constraint with a list of elements and generates the polynomial.- Parameters:
type- the type of the constraintolist- a vector containing the elements
-
Constraint
public Constraint(int type, java.lang.Object obj)Constructs a Constraint with a single element.- Parameters:
type- the type of the constraintobj- the element
-
Constraint
public Constraint(int type, java.lang.Object obj1, java.lang.Object obj2)Constructs a Constraint with two elements and generates the polynomial if required.- Parameters:
type- the type of the constraintobj1- the first elementobj2- the second element
-
Constraint
public Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, int prop)Constructs a Constraint with three elements and a proportion, and generates the polynomial if required.- Parameters:
type- the type of the constraintobj1- the first elementobj2- the second elementobj3- the third elementprop- the proportion
-
Constraint
public Constraint(int type, java.lang.Object obj1, int prop)Constructs a Constraint with a single element and a proportion, and generates the polynomial if required.- Parameters:
type- the type of the constraintobj1- the elementprop- the proportion
-
Constraint
public Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, int prop)Constructs a Constraint with four elements and a proportion, and generates the polynomial if required.- Parameters:
type- the type of the constraintobj1- the first elementobj2- the second elementobj3- the third elementobj4- the fourth elementprop- the proportion
-
Constraint
public Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5)Constructs a Constraint with five elements and generates the polynomial if required.- Parameters:
type- the type of the constraintobj1- the first elementobj2- the second elementobj3- the third elementobj4- the fourth elementobj5- the fifth element
-
Constraint
public Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3)Constructs a Constraint with three elements and generates the polynomial if required.- Parameters:
type- the type of the constraintobj1- the first elementobj2- the second elementobj3- the third element
-
Constraint
public Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4)Constructs a Constraint with four elements and generates the polynomial if required.- Parameters:
type- the type of the constraintobj1- the first elementobj2- the second elementobj3- the third elementobj4- the fourth element
-
Constraint
public Constraint(int type, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5, java.lang.Object obj6)Constructs a Constraint with six elements and generates the polynomial if required.- Parameters:
type- the type of the constraintobj1- the first elementobj2- the second elementobj3- the third elementobj4- the fourth elementobj5- the fifth elementobj6- the sixth element
-
-
Method Detail
-
getPolyListAndSetNull
public static TPoly getPolyListAndSetNull()
Retrieves the polynomial list and sets it to null.- Returns:
- the current polynomial list
-
GetConstraintType
public int GetConstraintType()
Gets the type of the constraint.- Returns:
- the type of the constraint
-
getelement
public java.lang.Object getelement(int i)
Retrieves an element from the element list at the specified index.- Parameters:
i- the index of the element to retrieve- Returns:
- the element at the specified index, or null if the index is out of bounds
-
getAllElements
public java.util.Vector getAllElements()
Retrieves all elements in the element list.- Returns:
- a vector containing all elements in the element list
-
calculate
public void calculate(Param[] para)
Calculates the polynomial representation using the given parameters.- Parameters:
para- an array of parameters to use for the calculation
-
addelement
public void addelement(java.lang.Object obj)
Adds an element to the element list if it is not null.- Parameters:
obj- the element to be added
-
setPolyGenerate
public void setPolyGenerate(boolean r)
Sets whether the polynomial should be generated.- Parameters:
r- true if the polynomial should be generated, false otherwise
-
addElement
public void addElement(java.lang.Object obj)
Adds an element to the element list.- Parameters:
obj- the element to be added
-
toString
public java.lang.String toString()
Returns the string representation of the constraint.- Overrides:
toStringin classjava.lang.Object- Returns:
- the string representation of the constraint
-
clear_all_cons
public void clear_all_cons()
Clears all constraints by setting the constraint descriptors to null.
-
addPoly
public void addPoly(TPoly tp)
Adds a polynomial to the polynomial list.- Parameters:
tp- the polynomial to be added
-
NewTPoly
public TPoly NewTPoly(TMono m1, TMono m2)
Creates a new TPoly object from two TMono objects.- Parameters:
m1- the first TMono objectm2- the second TMono object- Returns:
- the created TPoly object
-
Save
public void Save(java.io.DataOutputStream out) throws java.io.IOExceptionSaves the constraint data to a DataOutputStream.- Parameters:
out- the DataOutputStream to write to- Throws:
java.io.IOException- if an I/O error occurs
-
add_des
public void add_des(int t, CPoint p1, CPoint p2, CPoint p3, java.lang.Object obj)Adds a constraint description with three points and an additional object to the list of constraints.- Parameters:
t- the type of the constraintp1- the first pointp2- the second pointp3- the third pointobj- the additional object
-
add_des
public void add_des(int t, CPoint p1, CPoint p2, CPoint p3)Adds a constraint description with three points to the list of constraints.- Parameters:
t- the type of the constraintp1- the first pointp2- the second pointp3- the third point
-
add_des
public void add_des(int t, java.util.Vector v)Adds a constraint description with a vector of points to the list of constraints.- Parameters:
t- the type of the constraintv- the vector of points
-
less
public boolean less(CPoint a, CPoint b)
Compares two points based on their x-index.- Parameters:
a- the first pointb- the second point- Returns:
- true if the x-index of the first point is less than the x-index of the second point, false otherwise
-
add_desx1
public void add_desx1(int t, CPoint p1, CPoint p2, CPoint p3, CPoint p4)Adds a constraint description with four points to the list of constraints, ensuring the points are ordered by their x-index.- Parameters:
t- the type of the constraintp1- the first pointp2- the second pointp3- the third pointp4- the fourth point
-
add_des
public void add_des(int t, CPoint p1, CPoint p2, CPoint p3, CPoint p4)Adds a constraint description with four points to the list of constraints.- Parameters:
t- the type of the constraintp1- the first pointp2- the second pointp3- the third pointp4- the fourth point
-
add_des
public void add_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5)Adds a constraint description with five objects to the list of constraints.- Parameters:
t- the type of the constraintp1- the first objectp2- the second objectp3- the third objectp4- the fourth objectp5- the fifth object
-
add_des
public void add_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6)Adds a constraint description with six objects to the list of constraints.- Parameters:
t- the type of the constraintp1- the first objectp2- the second objectp3- the third objectp4- the fourth objectp5- the fifth objectp6- the sixth object
-
add_des
public void add_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7, java.lang.Object p8)Adds a constraint description with eight objects to the list of constraints.- Parameters:
t- the type of the constraintp1- the first objectp2- the second objectp3- the third objectp4- the fourth objectp5- the fifth objectp6- the sixth objectp7- the seventh objectp8- the eighth object
-
add_des
public void add_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7, java.lang.Object p8, java.lang.Object p9, java.lang.Object p10)Adds a constraint description with ten objects to the list of constraints.- Parameters:
t- the type of the constraintp1- the first objectp2- the second objectp3- the third objectp4- the fourth objectp5- the fifth objectp6- the sixth objectp7- the seventh objectp8- the eighth objectp9- the ninth objectp10- the tenth object
-
add_des
public void add_des(int t, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7)Adds a constraint description with seven objects to the list of constraints.- Parameters:
t- the type of the constraintp1- the first objectp2- the second objectp3- the third objectp4- the fourth objectp5- the fifth objectp6- the sixth objectp7- the seventh object
-
Load
public void Load(java.io.DataInputStream in, DrawProcess dp) throws java.io.IOExceptionLoads the constraint data from a DataInputStream.- Parameters:
in- the DataInputStream to read fromdp- the DrawProcess instance to use for retrieving elements- Throws:
java.io.IOException- if an I/O error occurs
-
get_sp_ag_value
public static double get_sp_ag_value(int v)
Returns the special angle value for the given angle in degrees.- Parameters:
v- the angle in degrees- Returns:
- the special angle value
-
check_constraint
public boolean check_constraint(double x, double y)Checks if the constraint is satisfied for the given coordinates.- Parameters:
x- the x-coordinatey- the y-coordinate- Returns:
- true if the constraint is satisfied, false otherwise
-
check_incenter
public boolean check_incenter(double x, double y)Checks if the incenter constraint is satisfied for the given coordinates.- Parameters:
x- the x-coordinatey- the y-coordinate- Returns:
- true if the incenter constraint is satisfied, false otherwise
-
check_agbisector
public boolean check_agbisector(double x, double y)Checks if the angle bisector constraint is satisfied for the given coordinates.- Parameters:
x- the x-coordinatey- the y-coordinate- Returns:
- true if the angle bisector constraint is satisfied, false otherwise
-
dr_pr
public double dr_pr(double x1, double y1, double x2, double y2, double x, double y)Calculates the determinant of the given points.- Parameters:
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 pointx- the x-coordinate of the third pointy- the y-coordinate of the third point- Returns:
- the determinant value
-
eqdistance
public TMono eqdistance(CPoint p1, CPoint p2, CPoint p3, CPoint p4)
Creates a TMono object representing the equality of distances between two pairs of points.- Parameters:
p1- the first point of the first pairp2- the second point of the first pairp3- the first point of the second pairp4- the second point of the second pair- Returns:
- the created TMono object
-
compareLN
public boolean compareLN(CLine ln1, CLine ln2)
Compares two lines based on the ID of their first points.- Parameters:
ln1- the first lineln2- the second line- Returns:
- true if the first point of the first line has a greater ID than the first point of the second line, false otherwise
-
parseTMonoString
public TMono parseTMonoString(java.lang.String name, java.lang.String func, int x)
Parses a TMono object from a string representation.- Parameters:
name- the name of the TMono objectfunc- the function stringx- the x-coordinate- Returns:
- the parsed TMono object
-
addZeron
public boolean addZeron(TMono m1)
Adds a zero coefficient to the TMono object if its length is 1.- Parameters:
m1- the TMono object- Returns:
- true if a zero coefficient was added, false otherwise
-
-