Sign in to follow this  

Partial derivatives of f(x,y)=z

This topic is 3374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a height map that can be viewed as a function with two variables. I know every value of f(x,y) where 0<=x<=some max value and 0<=y<=some max value. How do i calculate(or approximate) the value of the partial derivatives of f at the point x,y? How do these derivatives look like?

Share this post


Link to post
Share on other sites
If you take the height values above and below your point (y - 1) & (y + 1), and determine dy for (y - 1)->(y) and (y) ->(y + 1), and average them, that's an approximation for your partial derivative with respect to y. Repeat for x.

You can omit one of the data points for less accuracy but more speed (eg: just do (y-1)->(y), and skip the second one and the average).

Share this post


Link to post
Share on other sites
Quote:
Original post by Numsgil
If you take the height values above and below your point (y - 1) & (y + 1), and determine dy for (y - 1)->(y) and (y) ->(y + 1), and average them, that's an approximation for your partial derivative with respect to y. Repeat for x.

You can omit one of the data points for less accuracy but more speed (eg: just do (y-1)->(y), and skip the second one and the average).


How did you figure out this approximation, what's the theory behind it?

Share this post


Link to post
Share on other sites
Well what you're calculating is the partial derivatives with respect to a particular variable...this case x and y. The partial derivative at any particular point would be the slope at that point, with the slope being the change in f as you change x or y. or in other words (f(xn, y) - f(xn-1, y))/(xn - xn-1). If xn is equal to xn-1 + 1, then the denominator is one and you can just evaluate the numerator. This gives you the partial derivative for the point in between xn and xn-1. If you calculate twice with xn-1 and xn+1, then you approximate the partial for xn.

Share this post


Link to post
Share on other sites

This topic is 3374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this