Constructing smooth line from points
Constructing smooth line from points
- Subject: Constructing smooth line from points
- From: Rimas <email@hidden>
- Date: Wed, 23 Jan 2008 01:36:59 +0200
Hello everyone,
I have performed search in list archive, but I have not found an answer.
Situation:
I want to draw a graph (curve) throw some points. I have used cubic
spline interpolation. Mathematical result is great, but.. How to
display it? Lets say my graph will be 150 pixels wide. So I have 150
points (calculated). Firstly I have tried to draw separate pixels. The
result was terrible. Second I have used NSBezierPath and added all
points (tried appendBezierPathWithPoints:(NSPointArray)points count:
and lineToPoint:(NSPoint)aPoint). Now result is much better but far
away from perfect :(. Even turning antialiasing on does not help much.
The line is not smooth.
Question:
How could I draw smooth line when having ALL curve points.
Using Apple's Bezier Curves the result should be good enough, but I do
not have information about 2 curve control points - only where should
it start and end.
P.S. curve is not closed (first and last points are not equal).
Any help is appreciate.
Best Regards,
Rimas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden