Say I have a plane flying at a point on the Earth. The model of the Earth I am using has it's latitude going from -90/90 and longitude going from -180/180. The plane is flying at a lat/long of 80.123º and 170.123º and an altitude of 10,000 ft for example like in the attached picture. The plane also has a heading, which is it's angle from North. In the picture the angle is a little more than 180º so it's flying away from the North pole. Now, I want to find the latitude and longitude of a point from this plane. I am given a distance d, which is the distance between the plane and the point and it should be in the direction that the plane is pointing (the heading). I am also given the altitude of this point. Can someone please help me find a formula I can use to calculate the latitude/longitude of the point in general given any lat/long/altitude/heading of the plane? Thanks a lot.
#EDIT: Below is my conversion of Vitor's calculations to a Python script
r_earth = 3440 #earth radius in nautical miles
h_plane = 1.645788 #plane flying at 10000 ft in nautical miles
h_dest = 0
P = 90 #flying 90 degrees from North, so towards Florida
#lat,long of the center of Texas = 31.005753,-99.21390
d = 10 # point is 10 nautical miles away
PN = 58.994247 #latitude = 90 - PN
longitude = -99.21390
r_plane = r_earth + h_plane
r_dest = r_earth + h_dest
PD = math.acos((r_plane**2 + r_dest**2 - d**2)/(2*r_plane*r_dest))
ND = math.acos(math.cos(PN)*math.cos(PD) + math.sin(PN)*math.sin(PD)*math.cos(P))
N = math.asin(math.sin(PD)*math.sin(P)/math.sin(ND))
print(str(90 - ND) + "," + str(longitude + math.sin(N)))