コード例 #1
0
        //public static Pointing Create(Pointing ptg)
        //{
        //    Pointing temp = new Pointing();
        //    temp.theta = ptg.theta;
        //    temp.phi = ptg.phi;
        //    return temp;
        //}

        /** Simple constructor initializing both values.
         *  @param theta in radians [0,Pi]
         *  @param phi in radians [0,2*Pi] */
        public static Pointing Create(double theta, double phi)
        {
            Pointing temp = new Pointing();

            temp.theta = theta;
            temp.phi   = phi;
            return(temp);
        }
コード例 #2
0
ファイル: Hploc.cs プロジェクト: astrofrog/wwt-webgl-engine
        public Pointing toPointing()
        {
            double st;

            if (have_sth)
            {
                st = sth;
            }
            else
            {
                st = Math.Sqrt((1.0 - z) * (1.0 + z));
            }

            return(Pointing.Create(FastMath.atan2(st, z), phi));
        }