Class Point_d
java.lang.Object
Jcg.geometry.Point_d
- All Implemented Interfaces:
Comparable<Point_>,Point_
Class for representing a point in d-dimensional space R^d
- Version:
- dec 2012
- Author:
- Luca Castelli Aleardi, Ecole Polytechnique (INF562)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbarycenter(Point_[] points) Set the current point as the barycenter of an array of pointsintcompareCartesian(Point_ o, int i) Compare the i-th coordinate of two pointsintintReturn the dimension of the spacebooleanCheck equality between point coordinatesgetCartesian(int i) return the i-th cartesian coordinate of the pointvoidlinearCombination(Point_[] points, Number[] coefficients) Set the current point a linear combination of an array of points.Return the vector (p-q), where q is the current pointvoidsetCartesian(int i, Number x) set the i-th cartesian coordinatevoidset the coordinates of the originReturn the square distance ||p-q||^2, where q is the current pointtoString()Return a string (representation of the point)voidTranslate the current position of vector v
-
Field Details
-
coordinates
-
-
Constructor Details
-
Point_d
public Point_d(int d) -
Point_d
public Point_d(double[] coord) -
Point_d
-
-
Method Details
-
barycenter
Description copied from interface:Point_Set the current point as the barycenter of an array of points- Specified by:
barycenterin interfacePoint_
-
linearCombination
Description copied from interface:Point_Set the current point a linear combination of an array of points. Coefficients must sum to 1- Specified by:
linearCombinationin interfacePoint_
-
translateOf
Translate the current position of vector v- Specified by:
translateOfin interfacePoint_- Parameters:
v- the vector describing the translation
-
equals
-
toString
-
dimension
-
getCartesian
Description copied from interface:Point_return the i-th cartesian coordinate of the point- Specified by:
getCartesianin interfacePoint_
-
setCartesian
Description copied from interface:Point_set the i-th cartesian coordinate- Specified by:
setCartesianin interfacePoint_
-
setOrigin
-
minus
-
squareDistance
Description copied from interface:Point_Return the square distance ||p-q||^2, where q is the current point- Specified by:
squareDistancein interfacePoint_
-
compareTo
- Specified by:
compareToin interfaceComparable<Point_>
-
compareCartesian
Compare the i-th coordinate of two points- Specified by:
compareCartesianin interfacePoint_- Parameters:
o- the point to comparei- the i-th coordinate to compare- Returns:
- the result is -1 if first point is smaller then point o, return 1 is first point is greater then o, and 0 otherwise
-