Re: what is the analytical function for this 2D shape?
From: Rouben Rostamian (rouben_at_pc18.math.umbc.edu)
Date: 08/15/04
- Next message: cramer_at_unc.edu: "Re: Under what condition is Mahalanobis distance OPTIMAL?"
- Previous message: jeff: "Re: 1+i > i"
- In reply to: lucy: "what is the analytical function for this 2D shape?"
- Next in thread: lucy: "Re: what is the analytical function for this 2D shape?"
- Reply: lucy: "Re: what is the analytical function for this 2D shape?"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 15 Aug 2004 02:12:55 +0000 (UTC)
In article <cfm9ng$jvs$1@news.Stanford.EDU>, lucy <losemind@yahoo.com> wrote:
>
>I want to find an analytical function for the following 2D
>shape, let me try to describe it:
>
>It is in the form of z=f(x, y).
>
>The top of this function should be flat and looks like a
>rectangle, let's say the max height of this function is
>z_max. Then the contour of f(x, y) at that height is like a
>rectangle.
>
>The bottom of this function should look like a ellipse.
>That's to say, the contour of f(x, y) at the height z=0 is
>an ellipse.
>
>The aspect ratio for this ellipse will be in accordance
>with the aspect ratio for the rectangle at the top.
>
>Basically, it is almost like an elliptical 2D gaussian
>function being cut at some z-height, but the cut should be
>morphed into rectangle.
I think you meant a 3D shape rather than a 2D shape. The graph of
z=f(x,y) is a surface in 3D.
Anyway, let me paraphrase your question.
You are looking for a function z=f(x,y) such that the curve
f(x,y)=0 is an ellipse and the curve f(x,y)=h is a rectangle.
Let's do a slightly more general problem because it makes it
easier to see through the solution.
Suppose the shape of the contour at the bottom of the graph (z=0) is
described by the equation u(x,y) = 1.
Suppose the shape of the contour at the top of the graph (z=h) is
described by the equation v(x,y) = 1.
Now pick z as either:
z = f(x,y) = h [ u(x,y) - 1 ] / [ u(x,y) - v(x,y) ].
or
z = f(x,y) = h [ 1/u(x,y) - 1 ] / [ 1/u(x,y) - 1/v(x,y) ].
With either choice we see that:
z = 0 => u(x,y) = 1,
z = h => v(x,y) = 1,
as required. This solves the general problem.
Now let's look at your specific problem.
You want the bottom to be an ellipse. Therefore take:
u(x,y) = x^2/a^2 + y^2/b^2.
You want the top to be a rectangle. Therefore take:
v(x,y) = |x/c + y/d| + |x/c - y/d|.
Since you want the "aspect ratios" of the ellipse and rectangle to
be the same, you want to take c/d = a/b. For example, try a=4, b=2,
c=2, d=1.
Then construct f(x,y) according to one or the other recipe above,
whichever suits your needs.
Note that these formulas make sense only for point (x,y) that lie in
the region between the rectangle and the ellipse in the (x,y) plane.
If you apply f(x,y) to points outside this region, you are on your own.
If you have access to Maple, you can view the resulting surface by:
restart;
u := x^2/a^2 + y^2/b^2;
v := abs(x/c+y/d) + abs(x/c-y/d);
z := h*(1/u-1)/(1/u-1/v);
h := 2; a := 4; b := 2; c := 2; d := 1;
plot3d(z, x=-4..4, y=-2..2, view=0..h, grid=[50,50], style=patchnogrid,
lightmodel=light4, shading=Z, scaling=constrained);
-- rr
- Next message: cramer_at_unc.edu: "Re: Under what condition is Mahalanobis distance OPTIMAL?"
- Previous message: jeff: "Re: 1+i > i"
- In reply to: lucy: "what is the analytical function for this 2D shape?"
- Next in thread: lucy: "Re: what is the analytical function for this 2D shape?"
- Reply: lucy: "Re: what is the analytical function for this 2D shape?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|