getLength method
Implementation
double getLength() {
double length = math.sqrt(math.pow(x, 2) + math.pow(y, 2));
return length.isNaN ? 0 : length;
}
double getLength() {
double length = math.sqrt(math.pow(x, 2) + math.pow(y, 2));
return length.isNaN ? 0 : length;
}