Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Coordinate {
- private int x1, x2, y1, y2;
- private double lunghezzaSegmento, sezioneAurea;
- //Definisce le coordinate di un segmento e ne calcola la lunghezza e la sezione aurea.
- public Coordinate(int a, int b, int c, int d) {
- this.x1 = a;
- this.x2 = b;
- this.y1 = c;
- this.y2 = d;
- this.lunghezzaSegmento = Math.sqrt(Math.pow(x2-x1, 2)+ Math.pow(y2-y1, 2));
- this.sezioneAurea = this.lunghezzaSegmento / 1.618034;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement