Geometry Types

Vectors

3-dimensional vectors are represented as a 3-tuple. For example:

using System;
using System.Net;
using KRPC.Client;
using KRPC.Client.Services.SpaceCenter;

class VectorExample
{
    public static void Main ()
    {
        using (var connection = new Connection ()) {
            var vessel = connection.SpaceCenter ().ActiveVessel;
            Tuple<double,double,double> v = vessel.Flight ().Prograde;
            Console.WriteLine (v.Item1 + ", " + v.Item2 + ", " + v.Item3);
        }
    }
}

Quaternions

Quaternions (rotations in 3-dimensional space) are encoded as a 4-tuple containing the x, y, z and w components. For example:

using System;
using System.Net;
using KRPC.Client;
using KRPC.Client.Services.SpaceCenter;

class QuaternionExample
{
    public static void Main ()
    {
        using (var connection = new Connection ()) {
            var spaceCenter = connection.SpaceCenter ();
            var vessel = spaceCenter.ActiveVessel;
            Tuple<double,double,double,double> q = vessel.Flight ().Rotation;
            Console.WriteLine (q.Item1 + ", " + q.Item2 + ", " + q.Item3 + ", " + q.Item4);
        }
    }
}