So I randomly got bored and am now trying to figure out how to make the call of duty spy plane using a drone. I figured its basic geometry and I posted my math below. I am looking for help to make this more accurate as my project is open source and agricultural based.
Problem instance: - An Rc airplane equiped with a GIMBAL camera is at V1 or vector one. with g1 or gimbal angle and A1 be azimuth/direction (N,S,E,W). A person in the field is v2 or vector 2. Assume the gimbal angle directly points at the person or v2. if given V1(x,y,z),r, A1, G1, please find the location of the person or v2(x1,y1,z1). V1=(39.375346,10, -84.208137) G1=45 degrees A1= 3.14/4 or 45 degrees R= 10 radius to target or distance to target 180 degrees = west 90 degrees = south 270 degrees = north0 0 degrees = east
#python example.
# -*- coding: utf-8 -*-
#code by adam dabdoub
import math
import numpy
x = 39.375346
y = 10.0
z = -84.208137
V1 = {'X': x, 'Y': y, 'Z': z}
G1 = math.degrees(45) #degrees
A1 = math.degrees(45) # or 45 degrees
R = 10 #radius to target or distance to target
#180 degrees = west
#90 degrees = south
#270 degrees = north
#0 degrees = east
a = y
c = a//(math.cos(a))
b = math.sqrt(c ** 2 + a ** 2)
x1 = (b * math.cos(A1) + x)
y1 = ((y - y) + 4)
z1 = (b * math.sin(A1) + z)
V2 = (x1,y1,z1)
print("UAV Cordinates:\n", V1)
print("Person Cordinates:\n", V2)