4 * License : The MIT License
5 * Copyright(c) 2011 MikuToga Partners
8 package jp.sfjp.mikutoga.math;
16 public strictfp class EulerYXZ {
34 * @param xRot X軸回転量。(ラジアン)
35 * @param yRot Y軸回転量。(ラジアン)
36 * @param zRot Z軸回転量。(ラジアン)
38 public EulerYXZ(double xRot, double yRot, double zRot){
48 * @return X軸回転量を返す。(ラジアン)
50 public double getXRot(){
56 * @return Y軸回転量を返す。(ラジアン)
58 public double getYRot(){
64 * @return Z軸回転量を返す。(ラジアン)
66 public double getZRot(){
72 * @param xRotArg X軸回転量。(ラジアン)
74 public void setXRot(double xRotArg){
81 * @param yRotArg Y軸回転量。(ラジアン)
83 public void setYRot(double yRotArg){
90 * @param zRotArg Z軸回転量。(ラジアン)
92 public void setZRot(double zRotArg){
99 * @param xRotArg X軸回転量。(ラジアン)
100 * @param yRotArg Y軸回転量。(ラジアン)
101 * @param zRotArg Z軸回転量。(ラジアン)
103 public void setRot(double xRotArg, double yRotArg, double zRotArg){
117 private static String toString(double x, double y, double z){
118 StringBuilder result = new StringBuilder();
120 result.append("x=") .append(x);
121 result.append(" y=").append(y);
122 result.append(" z=").append(z);
124 return result.toString();
129 * @return {@inheritDoc}
132 public String toString(){
134 result = toString(this.xRot, this.yRot, this.zRot);
142 public String toDegString(){
143 double xDeg = StrictMath.toDegrees(this.xRot);
144 double yDeg = StrictMath.toDegrees(this.yRot);
145 double zDeg = StrictMath.toDegrees(this.zRot);
148 result = toString(xDeg, yDeg, zDeg);