Class CMPoint3f

java.lang.Object
kr.ac.konkuk.ccslab.cm.entity.CMPoint3f

public class CMPoint3f extends Object
This class represents position information in 3D coordinate.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
     
    float
     
    float
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    creates a default point object.
    CMPoint3f(float x, float y, float z)
    creates an point object.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 axis
      y - - the value of y axis
      z - - 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 axis
      y - - the value of y axis
      z - - the value of z axis
    • distance

      public float distance(CMPoint3f p1)
      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

      public float distanceSquared(CMPoint3f p1)
      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.