Interface MVector3d

  • All Superinterfaces:
    Vector3d

    public interface MVector3d
    extends Vector3d
    Interface for 3-dimensional vectors. This interface allows modification of vectors.
    Since:
    9.10.2
    • Method Detail

      • create

        static MVector3d create()
        Returns a new instance with all components set to zero.
        Returns:
        a new zero vector
        Since:
        9.10.2
      • create

        static MVector3d create​(double xyz)
        Returns a new instance with all components set to the given value.
        Parameters:
        xyz - the value set to all components of the returned vector
        Returns:
        a new instance with all components set to the given value
        Since:
        9.10.2
      • create

        static MVector3d create​(Vector3d vector)
        Returns a new instance with the same component values as in the given vector.
        Parameters:
        vector - the vector used for setting the values of the returned vector
        Returns:
        a new instance with the same component values as in the given vector
        Since:
        9.10.2
      • create

        static MVector3d create​(double x,
                                double y,
                                double z)
        Returns a new instance with the given component values.
        Parameters:
        x - the X component value
        y - the Y component value
        z - the Z component value
        Returns:
        a vector with the given component values
        Since:
        9.10.2
      • to3dVectors

        static List<MVector3d> to3dVectors​(List<? extends Vector2d> vectors)
        Returns a list of 3-dimensional vectors with the X and Y components from the given vectors and the Z component set to 0. The order of the vectors is preserved.
        Parameters:
        vectors - vectors in the XY-plane that are used for setting the X and Y components of the returned vectors
        Returns:
        a list of 3-dimensional vectors with the X and Y components from the given vectors and the Z component set to 0
        Since:
        9.10.2
      • addInPlace

        void addInPlace​(Vector3d vector)
        Adds the given vector to this vector in place.
        Parameters:
        vector - vector that is added to this
        Since:
        9.10.2
      • crossProductInPlace

        void crossProductInPlace​(Vector3d vector)
        Sets this vector to the cross product of this vector and the other vector.
        Parameters:
        vector - the vector with which the cross product is computed
        Since:
        9.10.2
      • negateInPlace

        void negateInPlace()
        Negates this vector in place.
        Since:
        9.10.2
      • normalizeInPlace

        void normalizeInPlace()
        Normalizes this vector in place. If the length of the vector is 0, then the components of the vector will become NaN.
        Since:
        9.10.2
      • interpolateInPlace

        void interpolateInPlace​(Vector3d vector,
                                double alpha)
        Interpolates linearly between this vector and the given vector and places the result in this vector (this = (1 - alpha) * this + alpha * vector). If the alpha value is greater than 1 it is set to 1 and if the alpha value is smaller than 0 it is set to 0.
        Parameters:
        vector - vector used for interpolation
        alpha - interpolation coefficient
        Since:
        9.10.2
      • scaleInPlace

        void scaleInPlace​(double scalar)
        Scales this vector in place by the given scalar.
        Parameters:
        scalar - the scalar by which this is scaled
        Since:
        9.10.2
      • set

        void set​(double x,
                 double y,
                 double z)
        Sets the value of this vector to the given values.
        Parameters:
        x - the value for X component
        y - the value for Y component
        z - the value for Z component
        Since:
        9.10.2
      • set

        void set​(Vector3d vector)
        Sets the value of this vector to the value of the given vector.
        Parameters:
        vector - the vector that specifies the value that is set to this vector
        Since:
        9.10.2
      • setX

        void setX​(double x)
        Sets the X component of this vector.
        Parameters:
        x - the value for the X component
        Since:
        9.10.2
      • setY

        void setY​(double y)
        Sets the Y component of this vector.
        Parameters:
        y - the value for the Y component.
        Since:
        9.10.2
      • setZ

        void setZ​(double z)
        Sets the Z component of this vector.
        Parameters:
        z - the value for the Z component
        Since:
        9.10.2
      • subtractInPlace

        void subtractInPlace​(Vector3d vector)
        Subtracts the given vector from this vector.
        Parameters:
        vector - vector that is subtracted from this
        Since:
        9.10.2