1 hour ago, fmatak said:Sorry, I copied from the napkin and forgot to add correct braces. Here you go:
t = ( 1 / a ) * ( atan( ( d + e * cos(a) ) / ( e * sin(a) ) ) ) ) )
The problem was with the last sin, it should be in the braces as well..
There are still 2 braces at the end which i've had to remove:
float t = ( 1 / a ) * ( atan( ( d + e * cos(a) ) / ( e * sin(a) ) ) );
float proofLHS = sin(a*t) * d;
float proofRHS = sin(a*(1-t)) * e;
ImGui::Text ("(4) lhs %f != rhs %f", proofLHS, proofRHS);
But the output is still wrong:
(4) lhs 0.514684 != rhs 0.410760
6 hours ago, lawnjelly said:sin(a*t)/sin(a*(1-t)) evaluates to sin(ta)
This makes no sense because sin(a*t)/sin(a*(1-t)) more looks like output of tan() with some scale, offsets and power, but it's nowhere close to a sine curve.
Also no luck with what i got from Wolfram Alpha.
I give up. I tried an iterative method, but the solver converged worse than the one i already have. I guess math guys would call my problem nonlinear and nonconvex. It solves for optimal UV map with angular constraints to force isotropy and matching scale / rotation at seams. My idea was to have a simpler solver working on just edges instead on the complex problem of a whole triangle ring around a vertex, but probably the more primitives you solve at once, the better.
So my working solver jitters and does not converge to an exact solution, but it is good enough and i use a second less constrained solver to fix the remaining inaccuracy. It's not elegant but it works and i'll have to stick at it.
Thanks anyways, guys! (I may revisit the problem if a solution comes up... )