mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-04-14 06:33:34 +02:00
Vector wirft nun eine Exception, wenn durch 0 geteilt wird
This commit is contained in:
@@ -361,6 +361,9 @@ public class Vector extends Point2D.Double {
|
||||
}
|
||||
|
||||
public Vector div( double scalar ) {
|
||||
if( scalar == 0.0 ) {
|
||||
throw new IllegalArgumentException("Can't divide by zero.");
|
||||
}
|
||||
x /= scalar;
|
||||
y /= scalar;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user