9 views (last 30 days)

Hey guys, this might be a simple problem but I'm going crazy here:

Assume you have two lines or direction vectors r,s from the point p (e.g. the origin):

p = [0 0 0]; r = [2 1 1]; s = [.2 0.1 .5];

Interpreting these vectors span a plane in R^3 (red vector is the normal vector):

This works fine with a normal meshgrid. What I really want is to create a grid "between" the r and s axis, and not a rectangular grid between the x and y values.

I can plot points along the vectors, so I have the coordinate for each star or diamond. Let's call them a and b (which are 3d vectors):

rn = r/norm(r); sn = s/norm(s);

a = linspace(p,p+rn,10);

b = linspace(p,p+sn,10);

plot3(a(1,:),a(2,:),a(3,:),'*')

plot3(b(1,:),b(2,:),b(3,:),'d')

How can I define a grid between a and b?

PS, this is only for visualization, I know that planes have an infinity spread ;)

Thank you very much! Jan

Opportunities for recent engineering grads.

Apply TodayFind the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
## 2 Comments

## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/215538-nonrectangular-grid-between-two-lines#comment_283618

⋮## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/215538-nonrectangular-grid-between-two-lines#comment_283618

## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/215538-nonrectangular-grid-between-two-lines#comment_285502

⋮## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/215538-nonrectangular-grid-between-two-lines#comment_285502

Sign in to comment.