From: Mico Filós <elmico.filos@gm...>  20080822 18:36:49

Hi, I am sorry if this is a trivial question but I cannot figure out how to do this. Imagine I have a nonlinear function f(x) and its linearization at some point (x0,f(x0)), given by y(x) = f'(x0) (x  x0) + y0, where y0 = f(x0). Imagine also that I don't use the same scale for the x and y axes. How can I obtain a straight line that *looks* perpendicular to the tangent y(x)? Since the x and y scales are not the same, a line with slope equal to 1/f'(x0) does not look perpendicular to y(x). I want to plot a straight line that passes through an arbitrary point of the tangent (not necessarily (x0,y0)) and that looks perpendicular to it. My idea is actually to plot the projection of an arbitrary point of the nonlinear function, (x1,f(x1)) to the subspace spanned by the tangent at x0. For me the most straightforward thing to do would be: * Compute the angle theta (on the actual canvas, i.e., as it looks on the screen) of the path defined by the tangent function y(x) * Plot a line path L with an angle theta + pi/2 that passes through some particular point of the tangent Q=(x0', y0'), which I specify. * Find the intersection R of the line L with the path defined by the nonlinear function. * Ideally, I would stroke only the portion of L that connects the point (x0',y0') with the intersection point R. Describing this in words is painful. I hope you see what I mean. Thanks a lot in for your patience. Mico 