normalize method
Implementation
Vector4D normalize() {
double length = this.length;
if (length == 0.0) length = 1.0;
final ilength = 1.0/length;
return .vec4(
x*ilength,
y*ilength,
z*ilength,
w*ilength,
);
}
Vector4D normalize() {
double length = this.length;
if (length == 0.0) length = 1.0;
final ilength = 1.0/length;
return .vec4(
x*ilength,
y*ilength,
z*ilength,
w*ilength,
);
}