|
-
Aug 13th, 2012, 02:14 AM
#7
Re: [RESOLVED] catenary problem
 Originally Posted by jemidiah
The assumptions are indeed slightly different, thanks to Windows' annoying inverted y-axis. If in Catenary_X1, pLeft.Y is 50 and pRight.Y is 100, pLeft is in fact above pRight by 50, so that v (== right y-value minus left y-value, assuming standard y-axis orientation) should be -50 whereas the line "Dim v As Double = pRight.Y - pLeft.Y" makes v=50 in this case. This flip has the effect of introducing a negative sign to each occurrence of v. The easiest fix is perhaps to use my original formula (which incidentally I am now entirely confident in, modulo obvious edge cases) while using "Dim v As Double = pLeft.Y - pRight.Y" in this particular routine. This is equivalent to your changes, though it's a little more direct. This wasn't a problem elsewhere mostly because v^2 was the important quantity and not v itself, so the sign change got washed out.
By the way, your changes work because...
(A(-v) - h)/2
= (a ln( (s+(-v)) / (s-(-v)) ) - h) / 2
= (a ln( (s-v) / (s+v) ) - h)/2
= (-a ln( (s+v) / (s-v) ) - h)/2
= -(a ln( (s+v) / (s-v) ) + h)/2
= -(A(v) + h)/2
P.S. Nice-looking hanging rope!
Ah, I suspected the y inversion might have something to do with it but I didn't think it through. I'm thinking of posting a version of the class to the VB.Net codebank since I have not found anything similar on the web. Assuming you don't mind, it will contain your recommended X1 derivation with acknowledgements .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|