.. role:: clio-static
   :class: clio-flag clio-flag-static


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

.. js:class:: wv.Point3

   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~wv.Point3.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~wv.Point3.x`
   * :js:data:`~wv.Point3.y`
   * :js:data:`~wv.Point3.z`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~static wv.Point3.add`
   * :js:meth:`~static wv.Point3.createFromArray`
   * :js:meth:`~static wv.Point3.cross`
   * :js:meth:`~static wv.Point3.distance`
   * :js:meth:`~static wv.Point3.dot`
   * :js:meth:`~static wv.Point3.fromJson`
   * :js:meth:`~static wv.Point3.magnitude`
   * :js:meth:`~static wv.Point3.normalize`
   * :js:meth:`~static wv.Point3.scale`
   * :js:meth:`~static wv.Point3.squaredLength`
   * :js:meth:`~static wv.Point3.subtract`
   * :js:meth:`~static wv.Point3.zero`
   * :js:meth:`~wv.Point3.add`
   * :js:meth:`~wv.Point3.assign`
   * :js:meth:`~wv.Point3.copy`
   * :js:meth:`~wv.Point3.equals`
   * :js:meth:`~wv.Point3.equalsWithTolerance`
   * :js:meth:`~wv.Point3.fromArray`
   * :js:meth:`~wv.Point3.isAxis`
   * :js:meth:`~wv.Point3.length`
   * :js:meth:`~wv.Point3.negate`
   * :js:meth:`~wv.Point3.normalize`
   * :js:meth:`~wv.Point3.scale`
   * :js:meth:`~wv.Point3.set`
   * :js:meth:`~wv.Point3.squaredLength`
   * :js:meth:`~wv.Point3.subtract`
   * :js:meth:`~wv.Point3.toArray`
   * :js:meth:`~wv.Point3.toJson`
   
   



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


.. js:method:: wv.Point3.constructor

      .. rst-class:: sig-pretty-signature
      
         | Point3(**x**\ : *number*\ , **y**\ : *number*\ , **z**\ : *number*\ ): :js:class:`Point3 <wv.Point3>`
      
      Creates a new point object.
      
      **Parameters**
      
      
         **x**\ : *number*
      
      
            X value
      
      
         **y**\ : *number*
      
      
            Y value
      
      
         **z**\ : *number*
      
      
            Z value
      
      
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      



.. rst-class:: kind-group kind-properties

.. rubric:: Properties
   :class: kind-group-title


.. js:data:: wv.Point3.x

      .. rst-class:: sig-pretty-signature
      
         | x: *number*
      



.. js:data:: wv.Point3.y

      .. rst-class:: sig-pretty-signature
      
         | y: *number*
      



.. js:data:: wv.Point3.z

      .. rst-class:: sig-pretty-signature
      
         | z: *number*
      



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: static wv.Point3.add

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | add(**p1**\ : :js:class:`IPoint3 <wv.IPoint3>`\ , **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): :js:class:`Point3 <wv.Point3>`
      
      Adds two points.
      
      **Parameters**
      
      
         **p1**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            First point.
      
      
         **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Second point.
      
      
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         Sum of p1 and p2.
      
      



.. js:method:: static wv.Point3.createFromArray

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | createFromArray(**arr**\ : *number*\ []): :js:class:`Point3 <wv.Point3>`
      
      Creates a point from an array of numbers
      
      **Parameters**
      
      
         **arr**\ : *number*\ []
      
      
            to assign from
      
      
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         new point set from array elements
      
      



.. js:method:: static wv.Point3.cross

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | cross(**p1**\ : :js:class:`IPoint3 <wv.IPoint3>`\ , **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): :js:class:`Point3 <wv.Point3>`
      
      Calculate cross product.
      
      **Parameters**
      
      
         **p1**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            First point.
      
      
         **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Second point.
      
      
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         Cross product of p1 and p2.
      
      



.. js:method:: static wv.Point3.distance

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | distance(**p1**\ : :js:class:`IPoint3 <wv.IPoint3>`\ , **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): *number*
      
      Calculate distance between two points
      
      **Parameters**
      
      
         **p1**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            First point
      
      
         **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Second point
      
      
      
      **Returns**\ : *number*
      
      
         Distance between p1 and p2
      
      



.. js:method:: static wv.Point3.dot

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | dot(**p1**\ : :js:class:`IPoint3 <wv.IPoint3>`\ , **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): *number*
      
      Calculate dot product.
      
      **Parameters**
      
      
         **p1**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            First point.
      
      
         **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Second point.
      
      
      
      **Returns**\ : *number*
      
      
         Dot product of p1 and p2.
      
      



.. js:method:: static wv.Point3.fromJson

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | fromJson(**objData**\ : *unknown*\ ): :js:class:`Point3 <wv.Point3>`
      
      Creates a new [[Point3]] from an object given by [[toJson]].
      
      **Parameters**
      
      
         **objData**\ : *unknown*
      
      
            An object given by [[toJson]].
      
      
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         The prepared object.
      
      



.. js:method:: static wv.Point3.magnitude

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | magnitude(**p**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): *number*
      
      Returns the length of a vector.
      
      **Parameters**
      
      
         **p**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
      **Returns**\ : *number*
      
      
         Vector length.
      
      



.. js:method:: static wv.Point3.normalize

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | normalize(**v**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): :js:class:`Point3 <wv.Point3>`
      
      Normalize a vector.
      
      **Parameters**
      
      
         **v**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            First point.
      
      
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         A vector that is colinear to v with a length of 1.
      
      



.. js:method:: static wv.Point3.scale

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | scale(**p**\ : :js:class:`IPoint3 <wv.IPoint3>`\ , **k**\ : *number*\ ): :js:class:`Point3 <wv.Point3>`
      
      Multiply all scalars of a given point by a same value
      
      **Parameters**
      
      
         **p**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Point to scale
      
      
         **k**\ : *number*
      
      
            Constant value used to scale p
      
      
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         p \* k
      
      



.. js:method:: static wv.Point3.squaredLength

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | squaredLength(**p**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): *number*
      
      Returns the squared length of a vector.
      
      **Parameters**
      
      
         **p**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
      **Returns**\ : *number*
      
      
         Vector squared length.
      
      



.. js:method:: static wv.Point3.subtract

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | subtract(**p1**\ : :js:class:`IPoint3 <wv.IPoint3>`\ , **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): :js:class:`Point3 <wv.Point3>`
      
      Subtract two points.
      
      **Parameters**
      
      
         **p1**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            First point.
      
      
         **p2**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Second point.
      
      
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         Difference of p1 and p2.
      
      



.. js:method:: static wv.Point3.zero

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | zero(): :js:class:`Point3 <wv.Point3>`
      
      Creates a new Point initialized to (0,0,0).
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         New point with all elements set to 0.
      
      



.. js:method:: wv.Point3.add

      .. rst-class:: sig-pretty-signature
      
         | add(**pt**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): *this*
      
      Adds another point to this point.
      
      **Parameters**
      
      
         **pt**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Point to add.
      
      
      
      **Returns**\ : *this*
      
      
         This point object.
      
      



.. js:method:: wv.Point3.assign

      .. rst-class:: sig-pretty-signature
      
         | assign(**point**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): *this*
      
      Sets this point equal to another point.
      
      **Parameters**
      
      
         **point**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            The point to assign.
      
      
      
      **Returns**\ : *this*
      
      
         This point object.
      
      



.. js:method:: wv.Point3.copy

      .. rst-class:: sig-pretty-signature
      
         | copy(): :js:class:`Point3 <wv.Point3>`
      
      Creates a copy of this point.
      
      **Returns**\ : :js:class:`Point3 <wv.Point3>`
      
      
         Copy of this point object.
      
      



.. js:method:: wv.Point3.equals

      .. rst-class:: sig-pretty-signature
      
         | equals(**other**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): *boolean*
      
      Strictly compares this point with another.
      
      **Parameters**
      
      
         **other**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Point to compare with.
      
      
      
      **Returns**\ : *boolean*
      
      
         True if the values of this point equal those of the other.
      
      



.. js:method:: wv.Point3.equalsWithTolerance

      .. rst-class:: sig-pretty-signature
      
         | equalsWithTolerance(**other**\ : :js:class:`IPoint3 <wv.IPoint3>`\ , **tolerance**\ : *number*\ ): *boolean*
      
      Compares this point with another using a tolerance.
      
      **Parameters**
      
      
         **other**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Point to compare with.
      
      
         **tolerance**\ : *number*
      
      
            Tolerance to be used in the comparison.
      
      
      
      **Returns**\ : *boolean*
      
      
         True if the values of this point equal those of the other.
      
      



.. js:method:: wv.Point3.fromArray

      .. rst-class:: sig-pretty-signature
      
         | fromArray(**arr**\ : *number*\ []): *this*
      
      Sets this point from an array.
      
      **Parameters**
      
      
         **arr**\ : *number*\ []
      
      
            Array to assign from.
      
      
      
      **Returns**\ : *this*
      
      
         This point object.
      
      



.. js:method:: wv.Point3.isAxis

      .. rst-class:: sig-pretty-signature
      
         | isAxis(): *boolean*
      
      Returns a boolean value indicating if this vector lies on a major axis.
      
      **Returns**\ : *boolean*
      



.. js:method:: wv.Point3.length

      .. rst-class:: sig-pretty-signature
      
         | length(): *number*
      
      Returns the length of this vector.
      
      **Returns**\ : *number*
      
      
         Vector length.
      
      



.. js:method:: wv.Point3.negate

      .. rst-class:: sig-pretty-signature
      
         | negate(): *this*
      
      Negates the point.
      
      **Returns**\ : *this*
      
      
         This object.
      
      



.. js:method:: wv.Point3.normalize

      .. rst-class:: sig-pretty-signature
      
         | normalize(): *this*
      
      Normalizes the vector.
      
      **Returns**\ : *this*
      
      
         This object.
      
      



.. js:method:: wv.Point3.scale

      .. rst-class:: sig-pretty-signature
      
         | scale(**k**\ : *number*\ ): *this*
      
      Scale the point by constant value.
      
      **Parameters**
      
      
         **k**\ : *number*
      
      
            Constant value to scale by.
      
      
      
      **Returns**\ : *this*
      
      
         Point object.
      
      



.. js:method:: wv.Point3.set

      .. rst-class:: sig-pretty-signature
      
         | set(**x**\ : *number*\ , **y**\ : *number*\ , **z**\ : *number*\ ): *this*
      
      Sets the values of this point.
      
      **Parameters**
      
      
         **x**\ : *number*
      
      
            X value to set.
      
      
         **y**\ : *number*
      
      
            Y value to set.
      
      
         **z**\ : *number*
      
      
            Z value to set.
      
      
      
      **Returns**\ : *this*
      
      
         This point object.
      
      



.. js:method:: wv.Point3.squaredLength

      .. rst-class:: sig-pretty-signature
      
         | squaredLength(): *number*
      
      Returns the squared length of this vector.
      
      **Returns**\ : *number*
      
      
         Vector squared length.
      
      



.. js:method:: wv.Point3.subtract

      .. rst-class:: sig-pretty-signature
      
         | subtract(**pt**\ : :js:class:`IPoint3 <wv.IPoint3>`\ ): *this*
      
      Subtracts another point from this point.
      
      **Parameters**
      
      
         **pt**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
            Point to subtract.
      
      
      
      **Returns**\ : *this*
      
      
         This point object.
      
      



.. js:method:: wv.Point3.toArray

      .. rst-class:: sig-pretty-signature
      
         | toArray(**arr**\ : *number*\ []?): *number*\ []
      
      Sets an array from this point.
      
      **Parameters**
      
      
         **arr**\ : *number*\ [] = ...
      
      
            Array to assign.
      
      
      
      **Returns**\ : *number*\ []
      



.. js:method:: wv.Point3.toJson

      .. rst-class:: sig-pretty-signature
      
         | toJson(): :js:class:`IPoint3 <wv.IPoint3>`
      
      Creates an object ready for JSON serialization.
      
      **Returns**\ : :js:class:`IPoint3 <wv.IPoint3>`
      
      
         The prepared object.
      
      




