# Plotting on a curve.. I need a math genius

**URL:** <https://forum.kirupa.com/t/plotting-on-a-curve-i-need-a-math-genius/225291>\
**Category:** flash\
**Created:** [May 10, 2007, 1:56pm UTC](https://forum.kirupa.com/t/plotting-on-a-curve-i-need-a-math-genius/225291 "2007-05-10T13:56:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gizma](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@gizma](https://forum.kirupa.com/u/gizma)\
**Post date:** [May 10, 2007, 1:56pm UTC](https://forum.kirupa.com/t/plotting-on-a-curve-i-need-a-math-genius/225291/1 "2007-05-10T13:56:31Z")

</div>

Hi All

Great forum! I have a problem you might be able to help me with.

I have a curveTo – an anchor point and a control point.  
Then I have a function that will return the x and y of a point along that curve if I give it a number as a percentage of the curve (0 to 1).

It looks like this, and works perfectly…

```auto
function drawOnCurve( interval:Number, x0,y0,x1,y1,x2,y2)
  {
         interval = Math.max( Math.min( 1, interval ), 0 );
         var intervalSq:Number = interval * interval;
         var difference:Number = 1 - interval;
         var differenceSq:Number = difference * difference;
         var _obj = new Object();
         _obj.x = differenceSq * x0 + 2 * interval * difference * x1 + intervalSq * x2;
         _obj.y = differenceSq * y0 + 2 * interval * difference * y1 + intervalSq * y2;
         return _obj;
  }
  // x0,y0 are the start point, x1,y1 the control point and x2,y2 the final anchor point

```

But… I want to give it a \_y value instead of a percentage (interval) and it return where on the curve that would intersect. Is that possible??

What r your thoughts, how should I do this?

Many Thanks  
Nic
