Follow-up Comment #8, bug #21735 (project mypaint):

The awesome Keith Scherb helped me figure this one out.  It is almost
ridiculous how simple the code is now.  Please give this a shot.  Seems to
work great.  Here are the changes needed in brushlib/mypaint-brush.c:

tilt_ascension = 180.0*atan2(-xtilt, ytilt)/M_PI;
      //float e;
      //if (abs(xtilt) > abs(ytilt)) {
        //e = sqrt(1+ytilt*ytilt);
        //e = abs(ytilt);
      //} else {
        //e = sqrt(1+xtilt*xtilt);
        //e = abs(xtilt);
      //}

      const float rad = hypot(xtilt, ytilt);
      //float cos_alpha = rad/e;
      //if (cos_alpha >= 1.0) cos_alpha = 1.0; // fix numerical inaccuracy
      //tilt_declination = 180.0*acos(cos_alpha)/M_PI;
      tilt_declination = 90-(rad*60);

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?21735>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Mypaint-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/mypaint-bugs

Reply via email to