public FixedNumber ToRotation() { if (x == 0 && y == 0) { return(new FixedNumber()); } FixedNumber sin = this.normalized.y; if (this.x >= 0) { return(MathFixed.Asin(sin) / MathFixed.PI * 180); } else { return(MathFixed.Asin(-sin) / MathFixed.PI * 180 + 180); } }
public Fixed ToRotation() { if (x == 0 && y == 0) { return(new Fixed()); } Fixed sin = this.normalized.y; Fixed result = Fixed.Zero; if (this.x >= 0) { result = MathFixed.Asin(sin) / MathFixed.PI * 180; } else { result = MathFixed.Asin(-sin) / MathFixed.PI * 180 + 180; } // if(result==0){ // Debug.LogError("this.normalized "+this.normalized+" MathFixed.Asin(sin) "+MathFixed.Asin(sin)); // } return(result); }