Kris' Blog

RSS feed

Square inscribed on a wedge (Updated)

My first xbap (works in IE only with .Net 3.0).

public static Rect GetSquareInscribedOnWedge(double a, double r, Point center)
{
    double t = Math.Tan(a/2);
    double x = Math.Sqrt(r*r/(1/(t*t) + 4/t + 5));
    return new Rect(center.X - x, center.Y - x/t - 2*x, 2*x, 2*x);
}

I’m too tired to say anything about it. I’ll write more later.