• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Does cocoa just leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does cocoa just leak?


  • Subject: Re: Does cocoa just leak?
  • From: Rob Rix <email@hidden>
  • Date: Sun, 30 Sep 2001 17:36:58 -0400

Could any one point me in the direction for the documentation / reference on the mathematics behind bezier paths?

I do google searches for bezier path/cubic spline math quite frequently.

Basically, you use the handy-dandy bezier curve equation:

(1t^1(1 - t)^0) + (1t^0(1 - t)^1) = 1

That's the basic bezier equation (it's just a straight line, since there are only two points involved). In order to get anything useful out of it, you have to multiply each section by a point:

P1(1t^1(1 - t)^0) + P2(1t^0(1 - t)^1) = 1

Again, this is a straight line: only two points (it's called a first degree bezier curve). To get an actual curve, you need at least three points:

P1(1t^2(1 - t)^0) + P2(2t^1(1 - t)^1) + P3(1t^0(1 - t)^2) = 1

For more points it becomes more complex, but that should do for a bezier path (unless its implemented using third-degree curves, which are a bit more complex).

Oh, and for all of these, let t = position along the curve. Note that this isn't an x or y position, this is a position along the length of the curve.

-- Rob

For this is summer--we spin slowly on the edge of song. - Kira Byers


References: 
 >Re: Does cocoa just leak? (From: j o a r <email@hidden>)

  • Prev by Date: How to determine a single pixels alpha?
  • Next by Date: Re: Odd stuff with Cocoa-Java
  • Previous by thread: Re: Does cocoa just leak?
  • Next by thread: Re: Does cocoa just leak?
  • Index(es):
    • Date
    • Thread