ฉันต้องการแก้ชุดสมการที่ไม่ใช่เชิงเส้นใน Matlab ฉันหมายถึงสมมติว่าฉันมีสองจุดที่กำหนดโดย (lat1,lon1) และ (lat2,lon2) ทีนี้ผมอยากหาจุด lat3,lon3 ซึ่งอยู่ห่างจากจุดทั้งสองจุด 20 กม. หาได้จากจุดตัดของวงกลมที่มีรัศมี 20 กม. โดยมีจุด (lat1,lon1) และ (lat2,lon2) เป็นจุดศูนย์กลาง
อย่างไรก็ตาม ฉันสับสนเล็กน้อยเกี่ยวกับวิธีการแก้สมการนี้
ฉันมีฟังก์ชั่นคำนวณระยะห่างระหว่างจุดสองจุดใน Matlab
function [ distance ] = calculateDistance( latitude1,longitude1,latitude2,longitude2 )
radius = 6371;
dLat = degtorad(latitude2-latitude1);
dLon = degtorad(longitude2-longitude1);
a = sin(dLat/2) * sin(dLat/2) + cos(degtorad(latitude1)) * cos(degtorad(latitude2)) * sin(dLon/2) * sin(dLon/2);
c = 2 * atan2(sqrt(a), sqrt(1-a));
distance = radius * c;
end
และฉันกำลังพยายามใช้ฟังก์ชันการแก้โจทย์ของ Matlab ที่ http://www.mathworks.com/help/toolbox/Symbolic/solve.html
อย่างไรก็ตามเมื่อฉันกำหนด
syms lat3 lon3
และพยายามให้สมการส่งผ่านไปยังฟังก์ชันแก้โจทย์ ซึ่งจะทำให้เกิดข้อผิดพลาดที่ atan2 only accepts arguments of type sym
ฉันจะทำสิ่งนี้ได้อย่างไร?