JavaFX rotate X Angle - Java JavaFX

Java examples for JavaFX:Shape

Description

JavaFX rotate X Angle

Demo Code


//package com.java2s;

import javafx.geometry.Point3D;

public class Main {
    public static double rotateXAngle(Point3D p1, Point3D p2) {
        double height = p2.getY() - p1.getY();
        double hypothenuse = p1.distance(p2);
        if (hypothenuse == 0.0) {
            return 0.0;
        }/*from  w ww . ja  v  a2s  . c o  m*/
        return Math.toDegrees(Math.asin(height / hypothenuse));
    }
}

Related Tutorials