Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Planar Curve

Subject: Planar Curve

From: Samit Biswas

Date: 13 Nov, 2010 15:01:04

Message: 1 of 12

Hello,

I want to form a Curve from a given curvature and arc length.


Thanks,
Samit

Subject: Planar Curve

From: John D'Errico

Date: 13 Nov, 2010 15:10:04

Message: 2 of 12

"Samit Biswas" <samitbiet@gmail.com> wrote in message <ibm97g$pc8$1@fred.mathworks.com>...
> Hello,
>
> I want to form a Curve from a given curvature and arc length.
>

You have provided insufficient information to do so,
and the crystal ball is soooo cloudy.

John

Subject: Planar Curve

From: Samit Biswas

Date: 13 Nov, 2010 16:22:04

Message: 3 of 12

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <ibm9oc$t2r$1@fred.mathworks.com>...
> "Samit Biswas" <samitbiet@gmail.com> wrote in message <ibm97g$pc8$1@fred.mathworks.com>...
> > Hello,
> >
> > I want to form a Curve from a given curvature and arc length.
> >
>
> You have provided insufficient information to do so,
> and the crystal ball is soooo cloudy.
>
> John

Thank you for ur reply
Detailed Information is given below:
curve is, r(t) = <x(t),y(t)>
And
x(t) = cos(t), y(t) = sin(t)

Now I want to form a curve of a specific curvature (k) and curve length(L), such as for k = 0, k > 0 and k < 0, L may be any length such as 50 or 100 data points
Range of t = 0 to pi /2


 

Subject: Planar Curve

From: ImageAnalyst

Date: 13 Nov, 2010 16:32:27

Message: 4 of 12

Are you looking for code on how to draw a circular arc?
http://www.mathworks.com/matlabcentral/newsreader/search_results?search_string=circular+arc

Some code by Matt Fig:
http://groups.google.com/group/comp.soft-sys.matlab/browse_frm/thread/71c05b49db923221/2aa7a525973bd466?hl=en

Subject: Planar Curve

From: John D'Errico

Date: 13 Nov, 2010 17:49:04

Message: 5 of 12

"Samit Biswas" <samitbiet@gmail.com> wrote in message <ibmdvc$q7l$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in message <ibm9oc$t2r$1@fred.mathworks.com>...
> > "Samit Biswas" <samitbiet@gmail.com> wrote in message <ibm97g$pc8$1@fred.mathworks.com>...
> > > Hello,
> > >
> > > I want to form a Curve from a given curvature and arc length.
> > >
> >
> > You have provided insufficient information to do so,
> > and the crystal ball is soooo cloudy.
> >
> > John
>
> Thank you for ur reply
> Detailed Information is given below:
> curve is, r(t) = <x(t),y(t)>
> And
> x(t) = cos(t), y(t) = sin(t)
>
> Now I want to form a curve of a specific curvature (k) and curve length(L), such as for k = 0, k > 0 and k < 0, L may be any length such as 50 or 100 data points
> Range of t = 0 to pi /2
>

x(t) = cos(t), y(t) = sin(t)

This is a PURELY circular arc, with a fixed, known
radius and known center point. It is trivially done.

For a general case, you have not given us sufficient
information. Is the curvature fixed along the curve?
Without specifying a given point on the curve, it is
completely under specified, as any translation of the
curve will not change either the arclength or the
curvature.

As importantly, you can also freely rotate such an
incompletely specified curve. As I said, you have not
given us enough information for a complete answer.

The number of points on the curve that you wish to
generate tells us nothing at all.

John

Subject: Planar Curve

From: Samit Biswas

Date: 13 Nov, 2010 17:59:04

Message: 6 of 12

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <ea971c0b-40e7-4f70-8520-7f85f7b369a6@w18g2000vbe.googlegroups.com>...
> Are you looking for code on how to draw a circular arc?
> http://www.mathworks.com/matlabcentral/newsreader/search_results?search_string=circular+arc
>
> Some code by Matt Fig:
> http://groups.google.com/group/comp.soft-sys.matlab/browse_frm/thread/71c05b49db923221/2aa7a525973bd466?hl=en


Thanks.....
r = 5;
ang = pi;
arcang = pi/2;
t = 0:.1:arcang;
x = -r*cos(t+ang)+c(1);
y = r*sin(t+ang)+c(2);
plot(x,y)
 
The above code plots a circular arc of curvature, k > 0

 For a specific curvature and for a specific angel of tangent how can i form a curve?
i.e. given information is curvature and angel of tangent

-----
Samit

I want to p

Subject: Planar Curve

From: Saurabh Mahapatra

Date: 13 Nov, 2010 18:23:04

Message: 7 of 12

These are my thoughts but please consult an elementary book on geometry: The geometric notion is a measurement of the turn. If you have a tangent vector v1 at point A, and then move infinitesimally, and that same tangent vector changed to v2, the amount of turn can be measured by cross product of these two vectors which by some complex algebra will turn to formulas you find in various textbooks.

Now, if you accept this notion,we could plot a curve whose accuracy will obviously depend on the granularity of your data set.

Step 1: Take any arbitrary point in the plane and label it as O. Draw a circular arc corresponding to K(0) and choose a point on the circumference as P.
Step 2: We don't know where the next point should be. But we do have information about the curvature of point P. If the curve is smooth and well-behaved, K(s) should also be. In other words, if you choose a infinitesimal arc length step r, then the new point Q can be constructed thus: Draw a circle of radius r and intersect it with the circle you drew in Step 1. The intersection points give you the new point Q. Choose a direction so that you eliminate one point.(this may require some notion of N-E-W-S thinking based on past and current coordinates)

Algebraically, it is simply constructing an isosceles triangle whose two sides are of radius curvature K(0) and the other side r.

Step 3: Replace P with this new point Q and iterate. You can build your geometric curve that way.

Keep in mind that arclength coordinate systems have no sense in Cartesian coordinates. They just exist as they are with regard to fundamental geometric properties.

The curve that you mention is a circle and would be a good test case to validate this rudimentary algorithm.

Subject: Planar Curve

From: Roger Stafford

Date: 13 Nov, 2010 23:46:06

Message: 8 of 12

"Samit Biswas" <samitbiet@gmail.com> wrote in message <ibmjl8$sbl$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <ea971c0b-40e7-4f70-8520-7f85f7b369a6@w18g2000vbe.googlegroups.com>...
> > Are you looking for code on how to draw a circular arc?
> > http://www.mathworks.com/matlabcentral/newsreader/search_results?search_string=circular+arc
> >
> > Some code by Matt Fig:
> > http://groups.google.com/group/comp.soft-sys.matlab/browse_frm/thread/71c05b49db923221/2aa7a525973bd466?hl=en
>
>
> Thanks.....
> r = 5;
> ang = pi;
> arcang = pi/2;
> t = 0:.1:arcang;
> x = -r*cos(t+ang)+c(1);
> y = r*sin(t+ang)+c(2);
> plot(x,y)
>
> The above code plots a circular arc of curvature, k > 0
>
> For a specific curvature and for a specific angel of tangent how can i form a curve?
> i.e. given information is curvature and angel of tangent
>
> -----
> Samit
>
> I want to p
- - - - - - - - -
  If the curvature is held constant, your problem is trivial as has been pointed out here. If you are asking for curvature to vary as some known function of arc length, it becomes a more interesting problem. You can use one of matlab's differential equation functions, ode45, etc. to find the curve. The differential equations would be:

 dt/ds = k; % <-- Where k is some function of arc length s
 dx/ds = cos(t);
 dy/ds = sin(t);

where you would have to supply the initial values for t, x, and y. The quantity s is arc length and you also need to furnish the desired range for s. The quantity t is the angle in radians that a tangent vector makes with respect to the x-axis in the direction of increasing s.

Roger Stafford

Subject: Planar Curve

From: Samit Biswas

Date: 14 Nov, 2010 05:50:04

Message: 9 of 12

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ibn7vu$q8b$1@fred.mathworks.com>...
> "Samit Biswas" <samitbiet@gmail.com> wrote in message <ibmjl8$sbl$1@fred.mathworks.com>...
> > ImageAnalyst <imageanalyst@mailinator.com> wrote in message <ea971c0b-40e7-4f70-8520-7f85f7b369a6@w18g2000vbe.googlegroups.com>...
> > > Are you looking for code on how to draw a circular arc?
> > > http://www.mathworks.com/matlabcentral/newsreader/search_results?search_string=circular+arc
> > >
> > > Some code by Matt Fig:
> > > http://groups.google.com/group/comp.soft-sys.matlab/browse_frm/thread/71c05b49db923221/2aa7a525973bd466?hl=en
> >
> >
> > Thanks.....
> > r = 5;
> > ang = pi;
> > arcang = pi/2;
> > t = 0:.1:arcang;
> > x = -r*cos(t+ang)+c(1);
> > y = r*sin(t+ang)+c(2);
> > plot(x,y)
> >
> > The above code plots a circular arc of curvature, k > 0
> >
> > For a specific curvature and for a specific angel of tangent how can i form a curve?
> > i.e. given information is curvature and angel of tangent
> >
> > -----
> > Samit
> >
> > I want to p
> - - - - - - - - -
> If the curvature is held constant, your problem is trivial as has been pointed out here. If you are asking for curvature to vary as some known function of arc length, it becomes a more interesting problem. You can use one of matlab's differential equation functions, ode45, etc. to find the curve. The differential equations would be:
>
> dt/ds = k; % <-- Where k is some function of arc length s
> dx/ds = cos(t);
> dy/ds = sin(t);
>
> where you would have to supply the initial values for t, x, and y. The quantity s is arc length and you also need to furnish the desired range for s. The quantity t is the angle in radians that a tangent vector makes with respect to the x-axis in the direction of increasing s.
>
> Roger Stafford

Thanks for the posted replies....
How can I Generate set of arcs for a fixed arc length. The arcs may be circular and may not be circular.

Subject: Planar Curve

From: Roger Stafford

Date: 14 Nov, 2010 06:16:03

Message: 10 of 12

"Samit Biswas" <samitbiet@gmail.com> wrote in message <ibntac$22m$1@fred.mathworks.com>...
> Thanks for the posted replies....
> How can I Generate set of arcs for a fixed arc length. The arcs may be circular and may not be circular.
- - - - - - - - -
  Once you have generated a curve of a given total arc length with either a fixed curvature or a curvature that varies as a given function of arc distance along the curve, you can create other curves from this one by translating and rotating this curve as desired. They will all have the same curvature profile and total arc length. It is not necessary to generate them each time. There is a vast number of threads in this newsgroup that have shown how to rotate and translate a set of x,y points.

Roger Stafford

Subject: Planar Curve

From: Samit Biswas

Date: 14 Nov, 2010 11:49:03

Message: 11 of 12

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ibnur3$bv5$1@fred.mathworks.com>...
> "Samit Biswas" <samitbiet@gmail.com> wrote in message <ibntac$22m$1@fred.mathworks.com>...
> > Thanks for the posted replies....
> > How can I Generate set of arcs for a fixed arc length. The arcs may be circular and may not be circular.
> - - - - - - - - -
> Once you have generated a curve of a given total arc length with either a fixed curvature or a curvature that varies as a given function of arc distance along the curve, you can create other curves from this one by translating and rotating this curve as desired. They will all have the same curvature profile and total arc length. It is not necessary to generate them each time. There is a vast number of threads in this newsgroup that have shown how to rotate and translate a set of x,y points.
>
> Roger Stafford


Consider the following code

%% ------
figure
t=linspace(0,(pi/2),20);
x= cos(t);y= sin(t);
plot(x,y);
x= 1.2*cos(t);y= sin(t);
hold on
plot(x,y);
x= 1.4*cos(t);y= sin(t);
hold on
plot(x,y);
x= 1.6*cos(t);y= sin(t);
hold on
plot(x,y);
x= 1.8*cos(t);y= sin(t);
hold on
plot(x,y);
x= 2*cos(t);y= sin(t);
hold on
plot(x,y);

x= 2*cos(t);y= 0* sin(t) + 1; %%curve like line for y==1
plot(x,y);


x= cos(t);y= -sin(t)+2;
plot(x,y);
x= 1.2*cos(t);y= -sin(t)+2;
hold on
plot(x,y);
x= 1.4*cos(t);y= -sin(t)+2;
hold on
plot(x,y);
x= 1.6*cos(t);y= -sin(t)+2;
hold on
plot(x,y);
x= 1.8*cos(t);y= -sin(t)+2;
hold on
plot(x,y);
x= 2*cos(t);y= -sin(t)+2;
hold on
plot(x,y);
%% ----

The above code generates a set of arcs. Here data points for x and y considered 20. In this case chord length(distance between starting point and ending point of an arc) is not same for all the arcs.

Now I have to generate that types of arcs where the chord length for the set of all arcs should be same. is there any best way to generate this types of curve ?

------
Samit Biswas

Subject: Planar Curve

From: Roger Stafford

Date: 14 Nov, 2010 13:45:05

Message: 12 of 12

"Samit Biswas" <samitbiet@gmail.com> wrote in message <iboibf$r40$1@fred.mathworks.com>...
> ........
> The above code generates a set of arcs. Here data points for x and y considered 20. In this case chord length(distance between starting point and ending point of an arc) is not same for all the arcs.
>
> Now I have to generate that types of arcs where the chord length for the set of all arcs should be same. is there any best way to generate this types of curve ?
> ........
- - - - - - - - - -
  You won't do it this way! These curves are portions of ellipses with differing eccentricities and therefore differing curvature profiles along their arc lengths (some have negative curvatures - they bend to the right.) There is no reason to suppose that their "chord lengths" would be the same.

  It really isn't clear to me what you are trying to accomplish here, Samit. I think you need to do a lot more explaining before receiving any further meaningful help.

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us