Пример #1
0
        private Vector MomentOfInertia()
        {
            if (shared.Vessel != FlightGlobals.ActiveVessel)
            {
                throw new KOSException("You may only call addons:MOI:I from the active vessel");
            }
            if (Available())
            {
                var I = InertiaTensor.Compute(shared.Vessel).Trace();
                return(new Vector(I));
            }

            throw new KOSUnavailableAddonException("I", "MomentOfInertia");
        }
Пример #2
0
        public Vector3 CalculateMomentOfInertia(Vessel v)
        {
            var inertiaTensor = InertiaTensor.Compute(v);

            return(inertiaTensor.Trace());
        }