com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class Vector2

  • java.lang.Object
    • com.aspose.threed.Vector2
  • All Implemented Interfaces:
    com.aspose.threed.Struct<Vector2>, java.io.Serializable, java.lang.Cloneable


    public final class Vector2
    extends java.lang.Object
    implements com.aspose.threed.Struct<Vector2>, java.io.Serializable
    A vector with two components.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      double x
      The x component.
      double y
      The y component.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Vector2() 
      Vector2(double s)
      Initializes a new instance of the Vector2 struct.
      Vector2(double x, double y)
      Initializes a new instance of the Vector2 struct.
    • 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(java.lang.Object obj)
        Check if two vector2 equals
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The object to compare.
        Returns:
        True if all components are identically equal.
      • toString

        public java.lang.String toString()
        Returns a String that represents the current Vector2.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A String that represents the current Vector2.
      • clone

        public Vector2 clone()
        Specified by:
        clone in interface com.aspose.threed.Struct<Vector2>
        Overrides:
        clone in class java.lang.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 java.lang.Object
        Returns:
        The hash code of the Vector2