Package kr.ac.konkuk.ccslab.cm.entity
Class CMPoint3f
java.lang.Object
kr.ac.konkuk.ccslab.cm.entity.CMPoint3f
This class represents position information in 3D coordinate.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
calculates the Euclidean distance between this point and another point (p1).float
calculates the Euclidean squared distance between this point and another point (p1).void
setPoint
(float x, float y, float z) sets the position information of the point object.
-
Field Details
-
m_x
public float m_x -
m_y
public float m_y -
m_z
public float m_z
-
-
Constructor Details
-
CMPoint3f
public CMPoint3f()creates a default point object. (x,y,z) is set to (0.0f, 0.0f, 0.0f) -
CMPoint3f
public CMPoint3f(float x, float y, float z) creates an point object.- Parameters:
x
- - the value of x axisy
- - the value of y axisz
- - the value of z axis
-
-
Method Details
-
setPoint
public void setPoint(float x, float y, float z) sets the position information of the point object.- Parameters:
x
- - the value of x axisy
- - the value of y axisz
- - the value of z axis
-
distance
calculates the Euclidean distance between this point and another point (p1).- Parameters:
p1
- - the point object from which this object calculates distance.- Returns:
- - the distance between this object and p1.
-
distanceSquared
calculates the Euclidean squared distance between this point and another point (p1).- Parameters:
p1
- - the point object from which this object calculates distance.- Returns:
- - the squared distance between this object and p1.
-