示例#1
0
        public SkyObject(string name, double mass, double radius,
                         Point initPosition, Vector initSpeed, SkyObject parentSun)
        {
            Name     = name;
            Mass     = mass;
            Radius   = radius;
            Position = initPosition;

            if (initSpeed != null)
            {
                Speed = initSpeed;
            }

            if (parentSun != null)
            {
                Speed += parentSun.GetSpeedForCircle(this);
            }
        }
示例#2
0
 public SkyObject(string name, double mass, double radius,
                  Point initPosition, SkyObject parentSun) :
     this(name, mass, radius, initPosition, null, parentSun)
 {
 }
示例#3
0
 public void LookAt(SkyObject skyObject) =>
 Origin = skyObject;