Advertisement
Guest User

Coordinate

a guest
Aug 28th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. public class Coordinate {
  2.         private int x1, x2, y1, y2;
  3.         private double lunghezzaSegmento, sezioneAurea;
  4.        
  5.         //Definisce le coordinate di un segmento e ne calcola la lunghezza e la sezione aurea.
  6.        
  7.         public Coordinate(int a, int b, int c, int d) {
  8.                 this.x1 = a;
  9.                 this.x2 = b;
  10.                 this.y1 = c;
  11.                 this.y2 = d;
  12.                 this.lunghezzaSegmento = Math.sqrt(Math.pow(x2-x1, 2)+ Math.pow(y2-y1, 2));
  13.                 this.sezioneAurea = this.lunghezzaSegmento / 1.618034;
  14.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement