# Finding the equation for the tangent plane to earth given latitude and longtiude

I'm creating a program where I need to calculate the equation of the plane tangent to the earth at a given latitude and longitude. I used Projecting an Arbitrary Latitude and Longitude onto a Tangent Plane to calculate the x and y coordinates of a unique point on the plane that is also the center of the plane with the positive y axis in the direction of North, but how would I use that to calculate the equation of the plane?

If you know that your plane is tangent at the point $(x_0,y_0,z_0)$ (Cartesian coordinates - and the point $(0,0,0)$ is the center of the earth) then the equation is $x_0(x-x_0)+y_0(y-y_0)+z_0(z-z_0)=0$ (for details see for example). I assume here that you consider the earth as a perfect ball.