# How to find an intersection of bezier curve and any function

Posted 8 years ago
1827 Views
|
2 Replies
|
0 Total Likes
|
 I have a table: {{0., 0., 0.}, {0.002, 0.08942, -0.08942}, {0.008, 0.233889, -0.178706}, {0.018, 0.366918, -0.267724}, {0.031, 0.496136, -0.350769}, {0.049, 0.639568, -0.439999}, {0.07, 0.779356, -0.5245}, {0.095, 0.922931, -0.609077}, {0.124, 1.06945, -0.693271}, {0.156, 1.21404, -0.77438}, {0.191, 1.35745, -0.852947}, {0.229, 1.50013, -0.929279}, {0.271, 1.64566, -1.00987}} Using this table I draw a BezierCurve, with first column as the x axis, second column as the top displacement and third column as the bottom displacement. Now I want to find an intersection with the Bezier Curve above and with a vertical line at x=0.08. Obviously I should get two points and the value I would be interested in (at given x) is the difference y between the two points. Now how do I do that? :/ I am confused since Bezier Curve isn't a f(x) function... Please help! :D
2 Replies
Sort By:
Posted 8 years ago
 My freely available package CurvesGraphics6 (http://www.dimi.uniud.it/gorni/Mma) defines BezierCurveFunction that you may find useful: Solve[(BezierCurveFunction[{{0., 0., 0.}, {0.002, 0.08942, -0.08942}, {0.008, 0.233889, -0.178706}, {0.018, 0.366918, -0.267724}, {0.031, 0.496136, -0.350769}, {0.049, 0.639568, -0.439999}, {0.07, 0.779356, -0.5245}, {0.095, 0.922931, -0.609077}, {0.124, 1.06945, -0.693271}, {0.156, 1.21404, -0.77438}, {0.191, 1.35745, -0.852947}, {0.229, 1.50013, -0.929279}, {0.271, 1.64566, -1.00987}}][ t] /. {x_, _, _} :> x) == .08] 
Posted 8 years ago
 BTW: I tried this Graphics[BezierCurve[Transpose[{data[[All, 1]], data[[All, 2]]}]]]* KroneckerDelta[0.08] but it doesn't really work theway I imagined. :/
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.