Package 

Class Point3D

  • 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
      int describeContents()
      void writeToParcel(Parcel dest, int flags)
      void set(Array<double> array) Set point object values from array.
      Array<double> asArray() Create a point3d object as an double array.
      void set(Point3D pos) Set this point from other Point3D object.
      final double distance(Point3D p1) Returns the distance between this point and point p1.
      final double xyDistance(Point3D p1) Returns the planar distance between this point and point p1.
      final Point3D subtract(Point3D p1) Returns the difference between this point and point p1.
      final Point3D addition(Point3D p1) Returns the sum of this point and point p1.
      double heightTo(Point3D p1) Calculates the height, distance in z.
      Point3D rotateX(double angle) Returns the new point rotated around x.
      Point3D rotateY(double angle) Returns the new point rotated around y.
      Point3D rotateZ(double angle) Returns the new point rotated around z.
      Point3D rotateX(double angle, Point3D pivot) Returns the new point rotated around x in pivotpoint.
      Point3D rotateY(double angle, Point3D pivot) Returns the new point rotated around y in pivotpoint.
      Point3D rotateZ(double angle, Point3D pivot) Returns the new point rotated around Z in pivotpoint.
      double angleTo(Point3D p1) Returns the angle between this point and point p1.
      String toString()
      boolean equals(Object o)
      • Methods inherited from class android.os.Parcelable

        describeContents, writeToParcel
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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

      • set

         void set(Array<double> array)

        Set point object values from array.

      • asArray

         Array<double> asArray()

        Create a point3d object as an double array.

      • set

         void set(Point3D pos)

        Set this point from other Point3D object.

      • 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 angle
        pivot - point
      • rotateY

         Point3D rotateY(double angle, Point3D pivot)

        Returns the new point rotated around y in pivotpoint.

        Parameters:
        angle - the angle
        pivot - he pivot point
      • rotateZ

         Point3D rotateZ(double angle, Point3D pivot)

        Returns the new point rotated around Z in pivotpoint.

        Parameters:
        angle - the angle
        pivot - 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