How Can You Project and Combine Two Topographical Curves onto the XY Plane?

AI Thread Summary
The discussion focuses on projecting two topographical curves from the XZ and YZ planes onto the XY plane while incorporating Z values for each (X,Y) coordinate. The curves are defined by the functions f(x) = exp(-x^2) and f(y) = exp(-y^2). The key mathematical approach proposed involves combining the two functions into a single expression, resulting in f(x,y) = exp(-(x^2+y^2)), which represents an isotropic function. The conversation also touches on the importance of understanding the projection of functions in more complex scenarios, where the assumptions of isotropy may not hold. The user is working on coding this projection and seeks assistance with the mathematical formulation rather than programming specifics.
swartzism
Messages
103
Reaction score
0
My question is a lot simpler than the whole process, but I've reached a plateau and need a push. My issue is that I want to take 2 curves, one in the XZ-plane, the other in the YZ-plane, combine them and project them down to the XY plane, but make it topographical (i.e. contain Z values given an (X,Y) coordinate).

I'm working with a very simple case of f(x) = exp(-x^2) and f(y) = exp(-y^2), so identical curves, just in different planes. The f(x) will give coordinates in (x,z) form, and f(y) gives (y,z). I'll worry about the programming, I just need help with the pseudoocode mathematics.

I'm not sure how to go about overlaying the two functions. I believe this should be a projection-type problem. I essentially have two vectors, let's call them fcnx (XZ) and fcny (YZ). The x and y values from the two will give me my (x,y) coordinate as desired, the z values are where I'm having my brain fart. Should I be taking the magnitude of the two z values? (sqrt(z1^2 + z2^2)?)

Any help?

Thanks in advance,

MS
 
Technology news on Phys.org
One way to look at the problem is that at each value of x, say x_0, you reproduce the function of y: f(x, 0) = exp(-x^2), f(0, y) = exp(-y^2), f(x0, y) = f(x0, 0)*f(0, y) and so on.

The end effect is f(x,y) = f(x, 0) * f(0, y) = exp(-x^2) * exp(-y^2) = exp(-(x^2+y^2)) = exp(-r^2) where r^2 = x^2+y^2 is the distance from the origin, so this is a nice isotropic function.

If your optics are more complicated, then your MTF can be anisotropic and the assumption that the MTF can be written as a product of the functions along the x- and y-axes breaks down.

In that case you have to work out the MTF as function of both coordinates from the beginning. Knowing only the projections of functions along the coordinate axes is not enough.
 
swartzism said:
My question is a lot simpler than the whole process, but I've reached a plateau and need a push. My issue is that I want to take 2 curves, one in the XZ-plane, the other in the YZ-plane, combine them and project them down to the XY plane, but make it topographical (i.e. contain Z values given an (X,Y) coordinate).

I'm working with a very simple case of f(x) = exp(-x^2) and f(y) = exp(-y^2), so identical curves, just in different planes. The f(x) will give coordinates in (x,z) form, and f(y) gives (y,z). I'll worry about the programming, I just need help with the pseudoocode mathematics.

I'm not sure how to go about overlaying the two functions. I believe this should be a projection-type problem. I essentially have two vectors, let's call them fcnx (XZ) and fcny (YZ). The x and y values from the two will give me my (x,y) coordinate as desired, the z values are where I'm having my brain fart. Should I be taking the magnitude of the two z values? (sqrt(z1^2 + z2^2)?)

Any help?

Thanks in advance,

MS

Hey swartzism and welcome to the forums.

Are you aware of holographic representations of information? These are general ways of encoding 3D data on a 2D projection-like surface.

If you have constraints (like for example you have a minimum lattice structure for your representation), then you can use this to construct a specific projection operator that will preserve bijectivity information when going from 3D to 2D.

Do you have any such constraints?
 
chiro - I don't believe so.

I've got my code doing what I want it to do so far. I don't believe that this is a real MTF from what I've read.

Code:
dim = 28;

fcnx    = zeros(1,dim);
fcny    = zeros(1,dim);
zval    = zeros(dim,dim);

% Fills 'dimension' matrix
dim_mtx = linspace(-1,1,dim);

% Define values for 2 functions fcnx (XZ), fcny (YZ)
for indx = 1:dim
    fcnx(indx) = exp(-dim_mtx(indx).^2);
    fcny(indx) = exp(-dim_mtx(indx).^2);
end

% Calculate Z values in a function zval using distance from the origin of (xi,yi)
for indx = 1:dim
    for jndx = 1:dim
        dist = sqrt(dim_mtx(indx).^2 + dim_mtx(jndx).^2);
        zval(indx,jndx) = sqrt((fcnx(indx)*dim_mtx(indx)/dist).^2 + (fcny(jndx)*dim_mtx(jndx)/dist).^2);
    end
end

% Plot surface
surf(zval,'DisplayName','zval');figure(gcf)

Very poorly written code so far, but I just wanted it to work. I'm going to make it pretty and nice.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
hi; i purchased 3 of these, AZDelivery 3 x AZ-MEGA2560-Board Bundle with Prototype Shield and each is reporting the error message below. I have triple checked every aspect of the set up and all seems in order, cable devices port, board reburn bootloader et al . I have substituted an arduino uno and it works fine; could you help please Thanks Martyn 'avrdude: ser_open(): can't set com-state for "\\.\COM3"avrdude: ser_drain(): read error: The handle is invalid.avrdude: ser_send(): write...
Back
Top