Forum: Poser - OFFICIAL


Subject: Loop-making script

Cage opened this issue on Apr 03, 2010 · 610 posts


markschum posted Sun, 11 April 2010 at 6:16 PM

sorry cage , my maths is just as bad as yours :)

I found some good explanations on the internet for solving the formula for a parabola if you have 3 points on it.  so if you have (-4,4)(0,1) (3,2) as points you can get the values for y = ax^2 + bx + c  (general formula for a parabola)  values a.b.c  and then calculate
for x = -4 to 3 step 0.5
  y = etc
next x   and create the curve.  (a bit more complex to calculate he exact positions and angles of each link but can be done ) 

you get three equations which can be solved by an inverse matrix multiplication :scared:
which some kind mathematician did http://stackoverflow.com/questions/717762/how-to-calculate-the-vertex-of-a-parabola-given-three-points

<pre class="prettyprint">
<span class="pln">denom </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x1 </span><span class="pun">-</span><span class="pln"> x2</span><span class="pun">)(</span><span class="pln">x1 </span><span class="pun">-</span><span class="pln"> x3</span><span class="pun">)(</span><span class="pln">x2 </span><span class="pun">-</span><span class="pln"> x3</span><span class="pun">)</span><span class="pln"><br></br>A </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x3 </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">y2 </span><span class="pun">-</span><span class="pln"> y1</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> x2 </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">y1 </span><span class="pun">-</span><span class="pln"> y3</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> x1 </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">y3 </span><span class="pun">-</span><span class="pln"> y2</span><span class="pun">))</span><span class="pln"> </span><span class="pun">/</span><span class="pln"> denom<br></br>B </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x3</span><span class="pun">^</span><span class="lit">2</span><span class="pln"> </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">y1 </span><span class="pun">-</span><span class="pln"> y2</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> x2</span><span class="pun">^</span><span class="lit">2</span><span class="pln"> </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">y3 </span><span class="pun">-</span><span class="pln"> y1</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> x1</span><span class="pun">^</span><span class="lit">2</span><span class="pln"> </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">y2 </span><span class="pun">-</span><span class="pln"> y3</span><span class="pun">))</span><span class="pln"> </span><span class="pun">/</span><span class="pln"> denom<br></br>C </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x2 </span><span class="pun">*</span><span class="pln"> x3 </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x2 </span><span class="pun">-</span><span class="pln"> x3</span><span class="pun">)</span><span class="pln"> </span><span class="pun">*</span><span class="pln"> y1 </span><span class="pun">+</span><span class="pln"> x3 </span><span class="pun">*</span><span class="pln"> x1 </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x3 </span><span class="pun">-</span><span class="pln"> x1</span><span class="pun">)</span><span class="pln"> </span><span class="pun">*</span><span class="pln"> y2 </span><span class="pun">+</span><span class="pln"> x1 </span><span class="pun">*</span><span class="pln"> x2 </span><span class="pun">*</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x1 </span><span class="pun">-</span><span class="pln"> x2</span><span class="pun">)</span><span class="pln"> </span><span class="pun">*</span><span class="pln"> y3</span><span class="pun">)</span><span class="pln"> </span><span class="pun">/</span><span class="pln"> denom</span>

with a     y = cosh(x)    I dont see how you solve that for selected endpoints.

Thats why in the past the chain scripts used a parabola for the shape, it seems easier to find the equations for the curve , finding the tangent at a point etc. . 

I will have a  look tonight for any catenery equations that might be helpful.