- class V2i
A signed 32 bits integer 2-element vector.
- x:int
- y:int
- V2i()
Uninitialized by default
- V2i(a: int)
Initialize to a scalar (a,a)
- V2i(a: int, b: int)
Initialize to given elements (a,b)
- __getitem__(i: int) int
Element access by index.
- equalWithAbsError(m: V2i, e: int) bool
Compare two vectors and test if they are “approximately equal”: Return True if the coefficients of this and m are the same with an absolute error of no more than e, i.e., for all i, j:
abs (this[i][j] - m[i][j]) <= e
- equalWithRelError(m: V2i, e: int) bool
Compare two vectors and test if they are “approximately equal”: Return True if the coefficients of this and m are the same with a relative error of no more than e, i.e., for all i, j:
abs (this[i] - v[i][j]) <= e * abs (this[i][j])
- length() int
Return the Euclidean norm
- length2() int
Return the square of the Euclidean norm, i.e. the dot product with itself.