returning two values from a function

Something along these lines:

struct angles {
    double a;
    double b;
};

struct angles f(double x, double y) {
    struct angles ang;

    ang.a = ....
    ang.b = ....

    return ang;
}

void loop() {
    struct angles theAngles;

    x = ...
    y = ...

    theAngles = f(x, y);
}
// inputs: x, y
// outputs: a, b
void f(double x, double y, double* a, double* b) {
    *a = ....
    *b = ....

    return;  // no return value
}

void loop() {
    double theta1;
    double theta2;

    x = ...
    y = ...

    f(x, y, &theta1, &theta2);
}