Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author Tomaz Lavieri
- */
- public class GeometricVector {
- private final Point3D start;
- private final Point3D end;
- public GeometricVector(Point3D start, Point3D end) {
- this.start = start;
- this.end = end;
- }
- public double size() {
- double xPow2 = Math.pow(end.getX()-start.getX(), 2);
- double yPow2 = Math.pow(end.getY()-start.getY(), 2);
- double zPow2 = Math.pow(end.getZ()-start.getZ(), 2);
- return Math.sqrt(xPow2 + yPow2 + zPow2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment