t4.cpp radius != R1 used in tangent (angle) calculations: addition of calculation comments likely to be useful
Hi,
The radius suggested by the code is as follows[1]:
R1=0.01
The radius observed on the UI is different (as follows): 0.0117076
It gets slightly better if +-R1 * ssin
is used for x coordinates for points 14 & 16: 0.0116577
But it's still != R1
.
Especially for those who try to follow the calucations, addition of calculation comments is likely to be useful.[2]
P.S. [1] https://gitlab.onelab.info/gmsh/gmsh/-/blob/master/tutorials/c++/t4.cpp?ref_type=heads [2] At present, on might try to verify the calculations (given that this seems not to be overly complicated at first glance) & not understand them, or conclude that they are approximative, etc. [3] In the worst case, something like the following would already be clearer:
double R1 = 1 * cm /* approximate radius */ // ...