# Verifying the hyperbolic law of cosines and law of sines..

I am trying to understand hyperbolic triangles. These two laws are supposedly universal in the hyperbolic plane.  However, whenever I've tried to verify them using applets which let me construct hyperbolic triangles either in the Poincaré disk model, or the Poincaré half-plane model, they never seem to be valid. The construction below serves as an example:

$$\sin(72.60867°) / \sinh(1.07)$$ $$=$$ $$0.74195\dots$$ whereas $$\sin(32.02868°) / \sinh(0.84)$$ $$=$$ $$0.56280\dots$$

Similarly, you will find an inequality when you try to verify the cosine law.

Have I fundamentally misunderstood something? Why do these laws never seem to hold up on any triangle? • What applet(s) are you using?
– Blue
Dec 23 '20 at 13:53
• I've tried several. All of them are based on geogebra. I'll link a few below. geogebra.org/m/eJAw9rcQ geogebra.org/m/DBXvbruR geogebra.org/m/…. I've also tried doing a construction on a cartesian diagram, which allows me to create the equivalent of a hyperbolic triangle in the Poincare half-disk.
– PLM
Dec 23 '20 at 14:02
• Your image looks like it comes from the Hyperbolic Canvas applet on GeoGebra.org. In the "Algebra" panel, the lengths given are lengths of arcs in the model, not the corresponding segment lengths in the hyperbolic plane. (You can tell this by placing a point at the center and one on the boundary. The "length" value will be $1$ —ie, the radius of the model's bounding circle— whereas it should be "infinity".) See here for how hyperbolic lengths should be calculated.
– Blue
Dec 23 '20 at 14:04
• I guess this means that this applet (and others too?) are extremely misleading. The button that I used to find the length of a side clearly states "hyperbolic distance"
– PLM
Dec 23 '20 at 14:13
• Thank you for the insight. I really appreciate your help. At least I won't spend hours now going over my work trying to figure out where I went wrong.
– PLM
Dec 23 '20 at 17:13

Expanding a comment ...

This Hyperbolic Canvas applet uses a number of under-the-hood constructions to get at the hyperbolic distance between two points in the Poincaré model. Here's a screenshot of the constructions based on "input" points $$A$$ and $$B$$. (I relabeled various elements to make sense of them as I was going through the process.) In a nutshell: We take a few steps to construct the orthogonal circle through $$A$$ and $$B$$ to determine ideal points $$A'$$ and $$B'$$. (There are conditional constructions to accommodate the circle being a diameter, etc.) Then the hyperbolic distance is calculated as $$d(A,B) = \left|\log\frac{|AB'||A'B|}{|AA'||BB'|}\right| \tag{1}$$

where $$|PQ|$$ indicates the Euclidean distance (marked eucPQ in the screenshot) between $$P$$ and $$Q$$ in the model. This is all geometrically correct. Equation $$(1)$$ is the first formula given in the Distance section of Wikipedia's "Poincaré disk model" entry.

A more-direct route to the distance, also given in Wikipedia, is

$$d(A,B) = \operatorname{arccosh}\left(1 + \frac{2|AB|^2}{(1-|OA|^2)(1-|OB|^2)} \right) \tag{2}$$

which requires nothing more than coordinates of points $$A$$ and $$B$$. Showing that $$(1)$$ and $$(2)$$ are equivalent is a nice exercise.

Now, even though $$(1)$$ and $$(2)$$ are equivalent, something seems to go wrong in the applet's implementation of $$(1)$$. Accumulated computational error from the numerous inherently-approximate constructions are at least partly to blame, especially since the input (model) points are already "close" by virtue of living inside the unit circle. The error may be compounded by the construction's conditional logic, but I haven't looked that hard. (Why the applet doesn't use the direct calculation of $$(2)$$ —especially since this is invisible to the user— is beyond me.)

To see how bad things get, consider a triangle with points $$A=(0.1,0.2)$$, $$B=(0.3,0.0)$$, $$C=(0.4, 0.5)$$. Here it is in the applet: The applet's "hyperbolic distance" tool gives $$a := d(B,C) = 0.56397 \qquad b := d(C,A) = 0.46909 \qquad c := d(A,B) = 0.26031 \tag3$$ but calculating the Euclidean distances directly from the coordinates and entering them into $$(2)$$ gives $$a = 1.29859 \qquad b = 1.08011 \qquad c = 0.59939 \tag4$$ Taking the calculated angles as correct, the Law of Sines applied to this second set of lengths gives $$\frac{\sin 91.5^\circ}{\sinh 1.29859} = \frac{\sin 50.1^\circ}{\sinh 1.08011} = \frac{\sin 22.02^\circ}{\sinh 0.59939} = 0.5895 \tag5$$ as expected from the Hyperbolic Law of Sines.

I can't actually say for sure that the applet's "hyperbolic distance" tool is using the construction shown at the top of this answer. (This was my first experience peering into a GeoGebra applet, and its author's under-the-hood labeling conventions weren't terribly clear. There are a handful of functions called "HyperbolicDistance". The construction shown was the first one.) Whatever the applet is doing to generate the distances in $$(3)$$, though, is obviously problematic because those distances are way off. I'll note that the applet also has trouble calculating angles when a vertex is at the origin.

So, all-in-all, the numerics of this particular applet are just plain untrustworthy, and the applet should probably only be used for a qualitative understanding of the Poincaré disk; eg, appreciating the broader nature of parallels, the non-constant angle sum, the curvy-looking (but not-actually-curvy) lines, and so forth.

P.S. When I want to draw a hyperbolic figure, I don't bother with special purpose macros in GeoGebra. I just construct what I need "from scratch" using standard GeoGebra tools. Perhaps the limitations of the applets will motivate OP to do the same thing; you're going to want to get good at this stuff, anyway. :)

For instance, while an applet might give you a one-click "hyperbolic line through two points" command, it's not at all complicated to construct the h-line from scratch: invert/reflect one of the points in the boundary circle, then invoke "circle through three points". Done! ... Well, there's an extra couple of steps to draw just the interior arc of the circle, but the point here is that a one-click command doesn't necessarily save you all that much work. (Indeed, the applet's path to the h-line is pretty complicated —just look at all those auxiliary elements!— so it may actually be doing a lot of unnecessary work.)

• @PLM: "Is the hyperbolic law of cosines also applicable in the Poincare half-plane?" ... Absolutely! The Law of Sines and Laws(!) of Cosines apply to hyperbolic geometry and therefore must be reflected in any model of hyperbolic geometry. (That's what models do! :) The tricky part is translating model measurements into hyperbolic ones. As shown here, the Upper Half Plane has its own counterpart of (2); interestingly, (1) transfers directly (which speaks to the power of the "cross-ratio", but I digress ...).
– Blue
Dec 24 '20 at 12:18