Reputation: 52840
Suppose you have
f(x)=x-floor(x)
.
By this, you can generate the grooves by gluing the top side and the bottom side together and then squeezing the left to zero -- now you have a conical helix: the line spins around the cone until it hits the bottom. You already have one form of the equations for the conical helix namely
x=a*cos(a); y=a*sin(a); z=a
. Now like here:How can you project the conical helix on the cone in Matlab?
Upvotes: 0
Views: 2766
Reputation: 26069
I'd approach your problem without using plot3
, instead I'd use meshgrid
and sinc
. Note that sinc
is a matlab built in functions that just do sin(x)./x
, for example:
So in 1-D, if I understand you correctly you want to "project" sinc(x)
on sqrt(x.^2)
. The problem with your question is that you mention projection with the dot product, but a dot product reduces the dimensionality, so a dot product of two vectors gives a scalar, and of two 2D surfaces - a vector, so I don't understand what you mean. From the 2-D plot you added I interpreted the question as to "dress" one function with the other, like in addition...
Here's the implementation:
N=64;
[x y]=meshgrid(linspace(-3*pi,3*pi,N),linspace(-3*pi,3*pi,N));
t=sqrt(x.^2+y.^2);
f=t+2*sinc(t);
subplot(1,2,1)
mesh(x,y,f) ; axis vis3d
subplot(1,2,2)
mesh(x,y,f)
view(0,0) ; axis square
colormap bone
The factor 2
in the sinc
was placed for better visualization of the fluctuations of the sinc
.
Upvotes: 4