Simultaneous solving of equations – who knew it would come to this?

Oh yeah.  I had a shoulder line with a slope.  Needed to make a  dart perpendicular to shoulder line at the midpoint. Aha!  Get slope of shoulder line, negate & invert to get perpendicular slope.  Use midpoint as center point of circle. Solve line and circle equations simultaneously.   My issues were that python doesn’t like ^ for exponents, likes ** instead.  Use as many parentheses as you can possibly stand, didn’t get the right results with  r / (1+m**2)**(1/2) .   This was changed to (r/((1+m**2)**(.5))) and it worked perfectly.  And did you notice my Quadratic Bezier Curve?

About Susan

FOSS digital patternmaking developer
This entry was posted in Design, Inkscape, Python, SVG and tagged , , , . Bookmark the permalink.

2 Responses to Simultaneous solving of equations – who knew it would come to this?

  1. Hey Susan, this is rather handy! Can we find the code somewhere?

    And BTW, maybe one of the reasons that the first expression didn’t work was that Python always returns integers when operating on integers, rounding if necessary — so 1/2 will return 0. A way to get the ‘correct’ value is to have one of the operands as a float — i.e. ‘1/2.’ (note the dot).

    Again, great stuff! Happy to have found your blog 🙂

  2. Susan says:

    hey ricardo! You were right about the integers. Thanks.