-
- All Implemented Interfaces:
-
android.os.Parcelable,se.cpacsystems.assist.common.Sqi
public class Point3D implements Sqi, Parcelable
Class for defining a point in 3D.
Contains helper methods for calculating distances and rotations.
-
-
Constructor Summary
Constructors Constructor Description Point3D()Default constructor. Point3D(double x, double y, double z)Constructor for each axis separately. Point3D(Array<double> array)Constructor for each axis in array. Point3D(Point3D pos)Copy constructor. Point3D(double x, double y, double z, int sqi, long id)Constructor for all data.
-
Method Summary
Modifier and Type Method Description intdescribeContents()voidwriteToParcel(Parcel dest, int flags)voidset(Array<double> array)Set point object values from array. Array<double>asArray()Create a point3d object as an double array. voidset(Point3D pos)Set this point from other Point3D object. final doubledistance(Point3D p1)Returns the distance between this point and point p1. final doublexyDistance(Point3D p1)Returns the planar distance between this point and point p1. final Point3Dsubtract(Point3D p1)Returns the difference between this point and point p1. final Point3Daddition(Point3D p1)Returns the sum of this point and point p1. doubleheightTo(Point3D p1)Calculates the height, distance in z. Point3DrotateX(double angle)Returns the new point rotated around x. Point3DrotateY(double angle)Returns the new point rotated around y. Point3DrotateZ(double angle)Returns the new point rotated around z. Point3DrotateX(double angle, Point3D pivot)Returns the new point rotated around x in pivotpoint. Point3DrotateY(double angle, Point3D pivot)Returns the new point rotated around y in pivotpoint. Point3DrotateZ(double angle, Point3D pivot)Returns the new point rotated around Z in pivotpoint. doubleangleTo(Point3D p1)Returns the angle between this point and point p1. StringtoString()booleanequals(Object o)-
-
Constructor Detail
-
Point3D
Point3D()
Default constructor.
-
Point3D
Point3D(double x, double y, double z)
Constructor for each axis separately.
-
Point3D
Point3D(Array<double> array)
Constructor for each axis in array.
-
Point3D
Point3D(Point3D pos)
Copy constructor.
-
Point3D
Point3D(double x, double y, double z, int sqi, long id)
Constructor for all data.
-
-
Method Detail
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
distance
final double distance(Point3D p1)
Returns the distance between this point and point p1.
- Parameters:
p1- the other point
-
xyDistance
final double xyDistance(Point3D p1)
Returns the planar distance between this point and point p1.
- Parameters:
p1- the other point
-
subtract
final Point3D subtract(Point3D p1)
Returns the difference between this point and point p1.
- Parameters:
p1- the other point
-
addition
final Point3D addition(Point3D p1)
Returns the sum of this point and point p1.
- Parameters:
p1- the other point
-
heightTo
double heightTo(Point3D p1)
Calculates the height, distance in z.
- Parameters:
p1- the other point
-
rotateX
Point3D rotateX(double angle)
Returns the new point rotated around x.
- Parameters:
angle- the angle
-
rotateY
Point3D rotateY(double angle)
Returns the new point rotated around y.
- Parameters:
angle- the angle
-
rotateZ
Point3D rotateZ(double angle)
Returns the new point rotated around z.
- Parameters:
angle- the angle
-
rotateX
Point3D rotateX(double angle, Point3D pivot)
Returns the new point rotated around x in pivotpoint.
- Parameters:
angle- the anglepivot- point
-
rotateY
Point3D rotateY(double angle, Point3D pivot)
Returns the new point rotated around y in pivotpoint.
- Parameters:
angle- the anglepivot- he pivot point
-
rotateZ
Point3D rotateZ(double angle, Point3D pivot)
Returns the new point rotated around Z in pivotpoint.
- Parameters:
angle- the anglepivot- the pivot point
-
angleTo
double angleTo(Point3D p1)
Returns the angle between this point and point p1.using this point as ref plane
- Parameters:
p1- the other point
-
-
-
-