예제 #1
0
파일: Utils.cs 프로젝트: mymess/Planetarium
        public Vec3D ToRectangular()
        {
            return(Vec3D.PolarToRectangular(RA.Get() * 15d, Declination.Get()));

            /*
             * double x = Math.Sin (RA.Get()*15d * M.DEG2RAD) * Math.Cos(Declination.Get()*M.DEG2RAD);
             * double y = Math.Sin (Declination.Get() * M.DEG2RAD);
             * double z = Math.Cos (RA.Get()*15d * M.DEG2RAD) * Math.Cos(Declination.Get()*M.DEG2RAD);
             *
             * return new Vec3D(x, y, z);
             */
        }
예제 #2
0
파일: Utils.cs 프로젝트: mymess/Planetarium
        public Vec3D ToRectangular()
        {
            return(Vec3D.PolarToRectangular(Azimuth.Get(), Altitude.Get()));

            /*
             * double x = Math.Sin (Azimuth.Get() * M.DEG2RAD) * Math.Cos(Altitude.Get()*M.DEG2RAD);
             * double y = Math.Sin (Altitude.Get() * M.DEG2RAD);
             * double z = Math.Cos (Azimuth.Get() * M.DEG2RAD) * Math.Cos(Altitude.Get()*M.DEG2RAD);
             * return new Vec3D (x, y, z);
             */
        }
예제 #3
0
파일: Utils.cs 프로젝트: mymess/Planetarium
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            DegreesAngle other = null;

            try{
                other = obj as DegreesAngle;
            }catch (InvalidCastException i) {
                Debug.Log("Cast exception ");
                return(false);
            }

            double otherAngle = other.Get();

            return(degrees > (otherAngle - THRESHOLD) && degrees < (otherAngle + THRESHOLD));
        }