.. role:: ts-api-decorator

######
Point3
######

.. container:: ts-api-section

   .. js:class:: Point3



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Point3.constructor`



.. container:: api-index-section

   .. rubric:: Properties

   .. rst-class:: api-index-list-item api-kind-property api-parent-kind-class

   * :js:attr:`~Point3.x`
   * :js:attr:`~Point3.y`
   * :js:attr:`~Point3.z`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Point3.add`
   * :js:meth:`~Point3.assign`
   * :js:meth:`~Point3.copy`
   * :js:meth:`~Point3.equals`
   * :js:meth:`~Point3.equalsWithTolerance`
   * :js:meth:`~Point3.fromArray`
   * :js:meth:`~Point3.isAxis`
   * :js:meth:`~Point3.length`
   * :js:meth:`~Point3.negate`
   * :js:meth:`~Point3.normalize`
   * :js:meth:`~Point3.scale`
   * :js:meth:`~Point3.set`
   * :js:meth:`~Point3.squaredLength`
   * :js:meth:`~Point3.subtract`
   * :js:meth:`~Point3.toArray`
   * :js:meth:`~Point3.toJson`
   * :js:meth:`~Point3.createFromArray`
   * :js:meth:`~Point3.cross`
   * :js:meth:`~Point3.distance`
   * :js:meth:`~Point3.dot`
   * :js:meth:`~Point3.fromJson`
   * :js:meth:`~Point3.zero`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: Point3.constructor( x, y, z)

      :param x: X value
      :type x: number
      :param y: Y value
      :type y: number
      :param z: Z value
      :type z: number


      Creates a new point object.


      :rtype: Point3



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: Point3.x

      :type: number





.. container:: ts-api-section

   .. js:attribute:: Point3.y

      :type: number





.. container:: ts-api-section

   .. js:attribute:: Point3.z

      :type: number





Methods
=======

.. rst-class:: ts-api-section

:ts-api-decorator:`static` add
------------------------------

.. js:method:: Point3.add( p1, p2)

   :param p1: First point.
   :type p1: Point3
   :param p2: Second point.
   :type p2: Point3


   Adds two points.

   :returns: Sum of p1 and p2.


   :rtype: Point3

.. rst-class:: ts-api-section

assign
------

.. js:method:: Point3.assign( point)

   :param point: The point to assign.
   :type point: Point3


   Sets this point equal to another point.

   :returns: This point object.


   :rtype: this

.. rst-class:: ts-api-section

copy
----

.. js:method:: Point3.copy()



   Creates a copy of this point.

   :returns: Copy of this point object.


   :rtype: Point3

.. rst-class:: ts-api-section

equals
------

.. js:method:: Point3.equals( other)

   :param other: Point to compare with.
   :type other: Point3


   Strictly compares this point with another.

   :returns: True if the values of this point equal those of the other.


   :rtype: boolean

.. rst-class:: ts-api-section

equalsWithTolerance
-------------------

.. js:method:: Point3.equalsWithTolerance( other, tolerance)

   :param other: Point to compare with.
   :type other: Point3
   :param tolerance: Tolerance to be used in the comparison.
   :type tolerance: number


   Compares this point with another using a tolerance.

   :returns: True if the values of this point equal those of the other.


   :rtype: boolean

.. rst-class:: ts-api-section

fromArray
---------

.. js:method:: Point3.fromArray( arr)

   :param arr: Array to assign from.
   :type arr: [number]


   Sets this point from an array.

   :returns: This point object.


   :rtype: this

.. rst-class:: ts-api-section

isAxis
------

.. js:method:: Point3.isAxis()



   Returns a boolean value indicating if this vector lies on a major axis.


   :rtype: boolean

.. rst-class:: ts-api-section

length
------

.. js:method:: Point3.length()



   Returns the length of this vector.

   :returns: Vector length.


   :rtype: number

.. rst-class:: ts-api-section

negate
------

.. js:method:: Point3.negate()



   Negates the point.

   :returns: This object.


   :rtype: this

.. rst-class:: ts-api-section

normalize
---------

.. js:method:: Point3.normalize()



   Normalizes the vector.

   :returns: This object.


   :rtype: this

.. rst-class:: ts-api-section

:ts-api-decorator:`static` scale
--------------------------------

.. js:method:: Point3.scale( p, k)

   :param p: None
   :type p: Point3
   :param k: Constant value to scale byS
   :type k: number


   Scale a point by a constant factor

   :returns: Copy of p scaled by a constant factor


   :rtype: Point3

.. rst-class:: ts-api-section

set
---

.. js:method:: Point3.set( x, y, z)

   :param x: X value to set.
   :type x: number
   :param y: Y value to set.
   :type y: number
   :param z: Z value to set.
   :type z: number


   Sets the values of this point.

   :returns: This point object.


   :rtype: this

.. rst-class:: ts-api-section

squaredLength
-------------

.. js:method:: Point3.squaredLength()



   Returns the squared length of this vector.

   :returns: Vector squared length.


   :rtype: number

.. rst-class:: ts-api-section

:ts-api-decorator:`static` subtract
-----------------------------------

.. js:method:: Point3.subtract( p1, p2)

   :param p1: First point.
   :type p1: Point3
   :param p2: Second point.
   :type p2: Point3


   Subtract two points.

   :returns: Difference of p1 and p2.


   :rtype: Point3

.. rst-class:: ts-api-section

toArray
-------

.. js:method:: Point3.toArray( arr)

   :param arr: Array to assign.
   :type arr: [number]


   Sets an array from this point.


   :rtype: [number]

.. rst-class:: ts-api-section

toJson
------

.. js:method:: Point3.toJson()



   Creates an object ready for JSON serialization.

   :returns: The prepared object.


   :rtype: IPoint3

.. rst-class:: ts-api-section

:ts-api-decorator:`static` createFromArray
------------------------------------------

.. js:method:: Point3.createFromArray( arr)

   :param arr: None
   :type arr: [number]


   Creates a point from an array of numbers

   :returns: new point set from array elements


   :rtype: Point3

.. rst-class:: ts-api-section

:ts-api-decorator:`static` cross
--------------------------------

.. js:method:: Point3.cross( p1, p2)

   :param p1: First point.
   :type p1: Point3
   :param p2: Second point.
   :type p2: Point3


   Calculate cross product.

   :returns: Cross product of p1 and p2.


   :rtype: Point3

.. rst-class:: ts-api-section

:ts-api-decorator:`static` distance
-----------------------------------

.. js:method:: Point3.distance( p1, p2)

   :param p1: First point
   :type p1: Point3
   :param p2: Second point
   :type p2: Point3


   Calculate distance between two points

   :returns: Distance between p1 and p2


   :rtype: number

.. rst-class:: ts-api-section

:ts-api-decorator:`static` dot
------------------------------

.. js:method:: Point3.dot( p1, p2)

   :param p1: First point.
   :type p1: Point3
   :param p2: Second point.
   :type p2: Point3


   Calculate dot product.

   :returns: Dot product of p1 and p2.


   :rtype: number

.. rst-class:: ts-api-section

:ts-api-decorator:`static` fromJson
-----------------------------------

.. js:method:: Point3.fromJson( objData)

   :param objData: An object given by [[toJson]].
   :type objData: unknown


   Creates a new [[Point3]] from an object given by [[toJson]].

   :returns: The prepared object.


   :rtype: Point3

.. rst-class:: ts-api-section

:ts-api-decorator:`static` zero
-------------------------------

.. js:method:: Point3.zero()



   Creates a new Point initialized to (0,0,0).

   :returns: New point with all elements set to 0.


   :rtype: Point3

