Re: Plot perpendicular lines of current plot? [message #60263] |
Fri, 09 May 2008 06:06 |
Loren Anderson
Messages: 22 Registered: August 2007
|
Junior Member |
|
|
On May 8, 6:20 am, Frank Wang <Muchi0...@gmail.com> wrote:
> Hi all,
> I have a data set for a contour plot, then how can I plot lines
> perpendicular to the contour lines(just like contour using the /
> downhill keyword)? Is there any existing procedures, or how should I
> manipulate the data to get a proper matrix for this? A lot of thanks.
>
> Regards,
> Frank
I attempted this a while back with good results, but can't seem to
find the code. Here's what I would do:
1) Use David Fanning's arcsample: http://www.dfanning.com/programs/arcsample.pro
to find the indices of the original curve where you'd like to draw the
perpendicular lines.
2) Find the slope of the original curve near these indices.
3) Take the negative reciprocal of this slope, create a new point from
the equation of this line.
4) Connect the points output from arcsample to these new points.
I remember there being some strange sign issues that you'll have to
work out.
-Loren
|
|
|