com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class Vector2

    • Field Detail

      • x

        public double x
        The x component.
      • y

        public double y
        The y component.
    • Constructor Detail

      • Vector2

        public Vector2(double s)
        Initializes a new instance of the Vector2 struct.
        Parameters:
        s - S.
      • Vector2

        public Vector2(double x,
                       double y)
        Initializes a new instance of the Vector2 struct.
        Parameters:
        x - The x coordinate.
        y - The y coordinate.
      • Vector2

        public Vector2()
    • Method Detail

      • getU

        public double getU()
        Gets the U component if the Vector2 is used as a mapping coordinate. It's an alias of x component.
      • setU

        public void setU(double value)
        Sets the U component if the Vector2 is used as a mapping coordinate. It's an alias of x component.
        Parameters:
        value - New value
      • getV

        public double getV()
        Gets the V component if the Vector2 is used as a mapping coordinate. It's an alias of y component.
      • setV

        public void setV(double value)
        Sets the V component if the Vector2 is used as a mapping coordinate. It's an alias of y component.
        Parameters:
        value - New value
      • dot

        public double dot(Vector2 rhs)
        Gets the dot product of two vectors
        Parameters:
        rhs - Right hand side value.
        Returns:
        The dot product of the two vectors.
      • getLength

        public double getLength()
        Gets the length.
      • add

        public static Vector2 add(Vector2 lhs,
                                  Vector2 rhs)
        Addition operator for Vector2
        Parameters:
        lhs - Left hand side value.
        rhs - Right hand side value.
        Returns:
        The result of addition.
      • sub

        public static Vector2 sub(Vector2 lhs,
                                  Vector2 rhs)
        Substraction operator for Vector2
        Parameters:
        lhs - Left hand side value.
        rhs - Right hand side value.
        Returns:
        The result of substraction.
      • div

        public static Vector2 div(Vector2 lhs,
                                  double rhs)
        Division operator for Vector2
        Parameters:
        lhs - Left hand side value.
        rhs - Right hand side value.
        Returns:
        The result of division.
      • mul

        public static Vector2 mul(Vector2 lhs,
                                  double rhs)
        Multiply operator for Vector2
        Parameters:
        lhs - Left hand side value.
        rhs - Right hand side value.
        Returns:
        The result of multiply.
      • mul

        public static Vector2 mul(double lhs,
                                  Vector2 rhs)
        Multiply operator for Vector2
        Parameters:
        lhs - Left hand side value.
        rhs - Right hand side value.
        Returns:
        The result of multiply.
      • op_eq

        public static boolean op_eq(Vector2 lhs,
                                    Vector2 rhs)
        Equal operator for Vector2
        Parameters:
        lhs - Left hand side value.
        rhs - Right hand side value.
        Returns:
        True if all components are identically equal.
      • op_ne

        public static boolean op_ne(Vector2 lhs,
                                    Vector2 rhs)
        Not-equal operator for Vector2
        Parameters:
        lhs - Left hand side value.
        rhs - Right hand side value.
        Returns:
        True if two vectors are not equal.
      • equals

        public boolean equals(Vector2 rhs)
        Check if two vector2 equals
        Parameters:
        rhs - The right hand side value.
        Returns:
        True if all components are identically equal.
      • equals

        public boolean equals(Object obj)
        Check if two vector2 equals
        Overrides:
        equals in class Object
        Parameters:
        obj - The object to compare.
        Returns:
        True if all components are identically equal.
      • clone

        public Vector2 clone()
        Specified by:
        clone in interface com.aspose.threed.Struct<Vector2>
        Overrides:
        clone in class Object
      • copyFrom

        public void copyFrom(Vector2 src)
        Specified by:
        copyFrom in interface com.aspose.threed.Struct<Vector2>
      • hashCode

        public int hashCode()
        Gets the hash code of Vector2
        Overrides:
        hashCode in class Object
        Returns:
        The hash code of the Vector2