mmp / pbr-book-website

Other
456 stars 62 forks source link

Fix the equation for the spherical triangle area #21

Closed massile closed 7 months ago

massile commented 8 months ago

Hello 👋 ,

I think I found an error in the equation of the spherical triangle area in terms of the cross and dot products of the vertices (https://pbr-book.org/4ed/Geometry_and_Transformations/Spherical_Geometry#eq:triangle-solid-angle-better)

According to the source code, reverting back to the tangeant from the area, we should get

tan(A/2) = (a . (b x c)) / (1 + (a . b) + (a . c) + (b . c))

while the equation shown is (cf screenshot below)

tan(A/2) = (A . (b x b)) / (1 + (a . b) + (a . c) + (b . c))

image

The following articles seem to agree with the equation I found as well:

mmp commented 7 months ago

Thanks!!