POV-Ray : Newsgroups : povray.newusers : normal of function Server Time
12 Nov 2024 19:18:52 EST (-0500)
  normal of function (Message 1 to 5 of 5)  
From: Elias Pschernig
Subject: normal of function
Date: 27 Oct 2001 15:16:25
Message: <3bdb0809@news.povray.org>
This is maybe a very simple question for some, but I had no luck finding
the answer with google, so I try it here: If I have a function of 2
variables, what is the 'normal vector' for a given point (x, y)?

e.g. f(x, y) = x ^ 2 * y

What is the normal vector at (1, 1) ?

I still remember from university that f'x(x, y) = 2 * x * y and
f'y(x, y) = x ^ 2. At (1, 1) this would give me f'x = 2 and f'y = 1 - but
from there on I'm lost..

If someone wonders why I need this, I asked here some time ago about how to
create normals for a mesh, and it worked quite well by taking near vertices
and building the cross product. I looked at the file for it again, and I
thought for mathematical created meshes it should be possible to directly
calculate the normal vector.

Thanks for any info

-- 
#macro C(X,Y)cylinder{X*x<X,0,-Y/2>.1}#end#macro U(R,X,Y)intersection{torus{.9
.1}box{-1 0rotate y*R*90}translate<X,0,Y>scale 1-z*.5}#end union{U(0,0,0)U(1,0
,0)U(2,-1,-1)U(1,1,0)U(1,1.5,-3)U(1,2,0)U(3,1,0)U(2,2,0)U(0,3,0)U(3,2,.5)C(.1,
2)C(.8,1)C(.8,-1)C(1.1,1)C(1.9,-1)pigment{rgb 10}rotate x*90translate<-1,0,4>}


Post a reply to this message

From: Christoph Hormann
Subject: Re: normal of function
Date: 27 Oct 2001 15:30:41
Message: <3BDB0B61.5CCD48CB@gmx.de>
Elias Pschernig wrote:
> 
> This is maybe a very simple question for some, but I had no luck finding
> the answer with google, so I try it here: If I have a function of 2
> variables, what is the 'normal vector' for a given point (x, y)?
> 

I'm not really sure what you mean, the gradient vector is simply the
vector of the partial derivatives.  It's identical to the normal of the
isosurface at this point.  

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Trevor Quayle
Subject: Re: normal of function
Date: 27 Oct 2001 15:37:15
Message: <3bdb0ceb$1@news.povray.org>
> e.g. f(x, y) = x ^ 2 * y
>
> What is the normal vector at (1, 1) ?
>
> I still remember from university that f'x(x, y) = 2 * x * y and
> f'y(x, y) = x ^ 2. At (1, 1) this would give me f'x = 2 and f'y = 1 - but
> from there on I'm lost..

as you say:
f(x, y) = x ^ 2 * y

f'x(x, y) = 2 * x * y, f'y(x, y) = x ^ 2

the two derivative functions give you slope functions in the x and y
directions respectively. Since the slope is a gradient (i.e., rise over run)
you can write the 2 functions as the following two vectors:

f'x(x, y) = 2 * x * y : <1,0,2*x*y>
f'y(x, y) = x ^ 2       : <0,1,x^2>

these represent the slope in th x and y directions, take the cross product
and you should have the normal.

-tgq


Post a reply to this message

From: Warp
Subject: Re: normal of function
Date: 27 Oct 2001 15:37:30
Message: <3bdb0cf9@news.povray.org>
Elias Pschernig <eli### [at] aonat> wrote:
: I still remember from university that f'x(x, y) = 2 * x * y and
: f'y(x, y) = x ^ 2. At (1, 1) this would give me f'x = 2 and f'y = 1 - but
: from there on I'm lost..

  The normal is the cross-product of the vectors <1, 0, f'x(x,y)> and
<0, 1, f'y(x,y)>, that is, vcross(<1, 0, 2>, <0, 1, 1>).

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Elias Pschernig
Subject: Re: normal of function
Date: 27 Oct 2001 15:43:35
Message: <3bdb0e67@news.povray.org>
Thanks to all who answered. It's exactly what I was looking for :)

-- 
#macro C(X,Y)cylinder{X*x<X,0,-Y/2>.1}#end#macro U(R,X,Y)intersection{torus{.9
.1}box{-1 0rotate y*R*90}translate<X,0,Y>scale 1-z*.5}#end union{U(0,0,0)U(1,0
,0)U(2,-1,-1)U(1,1,0)U(1,1.5,-3)U(1,2,0)U(3,1,0)U(2,2,0)U(0,3,0)U(3,2,.5)C(.1,
2)C(.8,1)C(.8,-1)C(1.1,1)C(1.9,-1)pigment{rgb 10}rotate x*90translate<-1,0,4>}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.