Esempio n. 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);
        }
Esempio n. 2
0
        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));
        }