About a year or so ago, or whenever it was, I decided to ask Microsoft Co-Pilot to help me write a C++ function that would calculate the angle bisectors of an arbitrary triangle, that is, without using conditional expressions or branches. The response that I got was, of course, completely wrong, so I put myself to the task of actually trying to write something that works, correctly, especially since if I was writing a game engine, and if I needed to compute the angle bisectors of millions of triangles, let's say CUDA style, well we all know what happens when one thread in a group of threads running concurrently causes a pipe-line stall. That's right - all other threads in the group will stall together. What a MESS! Unnecessary branches also increase the risk of Meltdown and/or Spectre-type attacks on vulnerable systems. So how much worse can it get?

Well, in any case - I put myself to the task of writing a solution that works, that is to say - according to my own self-imposed requirements, and for the part of actually doing that part of tessellation correctly, it isn't all that hard.
int triangle::generate_bisectors ()
{
fpoint U1,U2,U3;
MATH_TYPE d;
MATH_TYPE dx1,dx2,dx3,dy1,dy2,dy3;
MATH_TYPE L1,L2,L3;
MATH_TYPE c1,c2,c3,s1,s2,s3;
// first find the sines and cosines of the line
// segments that make up the triangle
dx1 = current[1].x-current[0].x; dx2 = current[1].x-current[2].x;
dx3 = current[2].x-current[0].x; dy1 = current[1].y-current[0].y;
dy2 = current[1].y-current[2].y; dy3 = current[2].y-current[0].y;
L1 = sqrt((dx1*dx1)+(dy1*dy1));
L2 = sqrt((dx2*dx2)+(dy2*dy2));
L3 = sqrt((dx3*dx3)+(dy3*dy3));
c1 = dx1*(1.0/L1); c2 = dx2*(1.0/L2); c3 = dx3*(1.0/L3);
s1 = dy1*(1.0/L1); s2 = dy2*(1.0/L2); s3 = dy3*(1.0/L3);
// now generate three points that represent the
// directional unit vectors for each line segment
// and then generate the compass points
fpoint C1,C2,C3,C4,C5,C6;
d = 1.0; // compass distance!
U1.x = d*c1; U1.y = d*s1;
U2.x = d*c2; U2.y = d*s2;
U3.x = d*c3; U3.y = d*s3;
C1 = current[0]+U1; C4 = current[0]+U3;
C2 = current[1]-U2; C5 = current[1]-U1;
C3 = current[2]-U3; C6 = current[2]+U2;
// the directional unit vectors can be used to find the midpint
// of a line that besects an isosceles triangle that forms
// from the base of the "arrow"
fpoint P0,P1,P2;
P0 = fpoint::midpoint (C1,C4);
P1 = fpoint::midpoint (C2,C5);
P2 = fpoint::midpoint (C3,C6);
fline AP1,BP2,CP3;
AP1 = fline (current[0],P0);
BP2 = fline (current[1],P1);
CP3 = fline (current[2],P2);
J = fpoint::intersect (AP1,BC);
K = fpoint::intersect (BP2,AC);
L = fpoint::intersect (CP3,AB);
return 0;
}
O.K., so that is one way of doing it. More work to be done, of course, checking the time, the time-zone, drawing the background image, drawing an hour hand, a minute hand, a second hand, etc. Then maybe redo the whole thing so that the same code base can be used for analog aviation instruments. Yet there is something very satisfying about knowing, going out the gate - that at least one really important detail, such as possibly having a very nice, even ornate pointer, is already done. Then again ...

Then again, of course, this is an excellent opportunity to mention Euclid, with 100's of proofs waiting to be properly rendered, all with just the right amount of rigor, naturally!
Naturally, we are going to need to do more than have an elaborate method for drawing a nice ornate pointer; we are going to need the clock face, some numbers, and so on. Yet, how are we going to do that? By appealing to functions like sine and cosine? Never! Although the law of sines might have been known during the times of Pythagoras and Euclid, there was no way to calculate sines and cosines of arbitrary numbers until after the invention of calculus. Yet there were other constructions that were well known, i.e., during the...
Read more »
Stop being a Microsoft slave. Seriously, Linux is just one other OS that has a full desktop. I'm using it right now and the clock/calandar widget is great. You can fully customize how the time is displayed. Your desire to continue to be abused by Microsoft is mystifying.