public class Pnt extends Object
Constructor and Description |
---|
Pnt(double[] coords)
Constructor.
|
Pnt(double coordA,
double coordB)
Constructor.
|
Pnt(double coordA,
double coordB,
double coordC)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Pnt |
add(Pnt p)
Add.
|
double |
angle(Pnt p)
Angle (in radians) between two Pnts (treated as vectors).
|
Pnt |
bisector(Pnt point)
Perpendicular bisector of two Pnts.
|
static Pnt |
circumcenter(Pnt[] simplex)
Circumcenter of a simplex.
|
static double |
content(Pnt[] simplex)
Determine the signed content (i.e., area or volume, etc.) of a simplex.
|
double |
coord(int i) |
static Pnt |
cross(Pnt[] matrix)
Compute generalized cross-product of the rows of a matrix.
|
static double |
determinant(Pnt[] matrix)
Compute the determinant of a matrix (array of Pnts).
|
int |
dimCheck(Pnt p)
Check that dimensions match.
|
int |
dimension() |
double |
dot(Pnt p)
Dot product.
|
boolean |
equals(Object other)
Equality.
|
Pnt |
extend(double[] coords)
Create a new Pnt by adding additional coordinates to this Pnt.
|
int |
hashCode()
HashCode.
|
boolean |
isInside(Pnt[] simplex)
Test if this Pnt is inside a simplex.
|
Pnt |
isOn(Pnt[] simplex)
Test if this Pnt is on a simplex.
|
Pnt |
isOutside(Pnt[] simplex)
Test if this Pnt is outside of simplex.
|
double |
magnitude()
Magnitude (as a vector).
|
static void |
main(String[] args)
Main program (used for testing).
|
int[] |
relation(Pnt[] simplex)
Relation between this Pnt and a simplex (represented as an array of Pnts).
|
Pnt |
subtract(Pnt p)
Subtract.
|
String |
toString()
Create a String for this Pnt.
|
static String |
toString(Pnt[] matrix)
Create a String for a matrix.
|
int |
vsCircumcircle(Pnt[] simplex)
Test relation between this Pnt and circumcircle of a simplex.
|
public Pnt(double[] coords)
coords
- the coordinatespublic Pnt(double coordA, double coordB)
coordA
- coordB
- public Pnt(double coordA, double coordB, double coordC)
coordA
- coordB
- coordC
- public String toString()
public boolean equals(Object other)
public int hashCode()
public double coord(int i)
ArrayIndexOutOfBoundsException
- for bad coordinatepublic int dimension()
public int dimCheck(Pnt p)
p
- the Pnt to check (against this Pnt)IllegalArgumentException
- if dimension fail to matchpublic Pnt extend(double[] coords)
coords
- the new coordinates (added on the right end)public double dot(Pnt p)
p
- the other Pntpublic double magnitude()
public Pnt subtract(Pnt p)
p
- the other Pntpublic double angle(Pnt p)
p
- the other Pntpublic Pnt bisector(Pnt point)
point
- the other pointpublic static String toString(Pnt[] matrix)
matrix
- the matrix (an array of Pnts)public static double determinant(Pnt[] matrix)
matrix
- the matrix as an array of PntsIllegalArgumentException
- if dimensions are wrongpublic static Pnt cross(Pnt[] matrix)
matrix
- the matrix of Pnts (one less row than the Pnt dimension)IllegalArgumentException
- if matrix is wrong shapepublic static double content(Pnt[] simplex)
simplex
- the simplex (as an array of Pnts)public int[] relation(Pnt[] simplex)
-1 means Pnt is on same side of facet 0 means Pnt is on the facet +1 means Pnt is on opposite side of facet
simplex
- an array of Pnts representing a simplexIllegalArgumentException
- if the simplex is degeneratepublic Pnt isOutside(Pnt[] simplex)
simplex
- the simplex (an array of Pnts)public Pnt isOn(Pnt[] simplex)
simplex
- the simplex (an array of Pnts)public boolean isInside(Pnt[] simplex)
simplex
- the simplex (an arary of Pnts)public int vsCircumcircle(Pnt[] simplex)
simplex
- the simplex (as an array of Pnts)public static Pnt circumcenter(Pnt[] simplex)
simplex
- the simplex (as an array of Pnts)public static void main(String[] args)
Copyright © 2015–2021 Fiji. All rights reserved.