algebra_3D.Vector.setLength

Vector.setLength()

Change the length of the vector without lambda-multiplication (you can define a precise length).

Parameters

Type

Description

length

double

The new length of the self vector

precision

int

The precision indice : bigger mean more precise

Examples

>>> v=Vector(0,0,0,2,2,2)
>>> print(v.length())
3.4641016151377544
>>> v.setLength(4)
>>> print(v)
 ( 2.309402000000009 , 2.309402000000009 , 2.309402000000009 )
printed
>>> print(v.length())
4.0000015991011955