Create a 2D vector of the specified scalar type; omitted components are zero. A source vector can also be converted and copied.
scalarTypeComponent storage type; i64/u64 use bigint, others use number.
Copy the vector and its scalar type with independent storage.
sourceThe X component; writes follow the TypedArray conversion rules for scalarType.
The Y component; writes follow the TypedArray conversion rules for scalarType.
Return the angle relative to the positive X axis; only for nonzero floating-point vectors.
thisReturn the signed angle from this vector to rhs; both must be nonzero floating-point vectors of the same type.
thisrhsReturn a new vector divided component-wise by rhs of the same type; throw RangeError if any divisor is zero.
rhsReturn a new vector multiplied component-wise by rhs of the same type.
rhsProtectedcreateReturn the 2D cross-product scalar x·rhs.y−y·rhs.x; rhs must have the same scalar type.
rhsReturn the dot product x·rhs.x+y·rhs.y with rhs of the same type.
rhsReturn the Euclidean length; only available for floating-point vectors.
thisReturn x²+y², calculated with the current scalar type's precision and range.
Return a unit vector in the same direction; only for floating-point vectors. A zero vector throws RangeError.
thisReturn the projection onto axis; axis must be a nonzero floating-point vector of the same type.
thisaxisReturn a new floating-point vector rotated by phi; positive angles are clockwise in screen coordinates.
thisphi
sf::Vector2, with a native handle lazily bound to its existing storage.