Vector2 — Aspose.3D FOSS for Java

Enumerations

Vector2 एक double-precision 2-घटक वेक्टर है जिसमें x और y घटक। यह मुख्य रूप से UV टेक्सचर कोऑर्डिनेट्स और 2D गणनाओं के लिए उपयोग किया जाता है।.

Enumerations: com.aspose.threed

import com.aspose.threed.*;

Vector2 uv = new Vector2(0.5, 0.75);

Enumerations

EnumerationsEnumerations
Vector2()शून्य वेक्टर बनाता है (0, 0)
Vector2(double x, double y)दो घटकों से बनाता है
Vector2(Vector2 other)कॉपी कंस्ट्रक्टर

सार्वजनिक फ़ील्ड्स

Vector2 उपयोग करता है सार्वजनिक फ़ील्ड्स घटक पहुंच के लिए (गेटर/सेटर मेथड्स नहीं):

EnumerationsEnumerationsEnumerationsEnumerations
xdoublev.xX घटक
ydoublev.yY घटक

गणना किए गए गुण

EnumerationsEnumerationsEnumerationsEnumerations
lengthdoublegetLength()यूक्लिडियन लंबाई, केवल-पढ़ने योग्य
length2doublegetLength2()वर्ग लंबाई, केवल-पढ़ने योग्य

Enumerations

Enumerationsरिटर्न टाइपEnumerations
dot(Vector2 rhs)doubleदूसरे के साथ डॉट प्रोडक्ट Vector2
normalize()Vector2एक यूनिट-लेंथ कॉपी लौटाता है
set(double x, double y)voidदोनों घटकों को जगह पर सेट करता है
compareTo(Vector2 other)intशाब्दिक तुलना: -1, 0, या 1 लौटाता है

Enumerations

import com.aspose.threed.*;

Vector2 a = new Vector2(1.0, 0.0);
Vector2 b = new Vector2(0.0, 1.0);

double dot = a.dot(b);           // 0.0
Vector2 norm = a.normalize();     // Vector2(1.0, 0.0)
System.out.println(a.getLength());  // 1.0

संबंधित देखें

 हिन्दी