QUESTION.
A student asked for an example of a DOMAIN REQUIREMENT mentioned in the Satellite Vehicle Tracking (SVT) User Requirements Document.
ANSWER. Item 9.1 is an example of a domain requirement.
Item 9.1 - It is extremely important that the speed, distance travelled and vehicle location calculations are verified to be correct. It is the responsibility of the consultant and the vendor to demonstrate this to VMS Inc.
EXPLANATIONS.
(1) A domain requirement is a requirement that is specific to a particular field or subject. It is not a requirement generally known to the common person and not a requirement that we can consider as common sense or common knowledge.
(2) In this SVT case, we are talking about satellite coordinates (latitude and longitude) and we are supposed to provide verifiably correct calculations of the distance travelled. This requires specific knowledge.
(3) We cannot just apply the satellite coordinates (latitude and longitude) for two points on earth (x1,y1) and (x2,y2) and use linear trigonometry (straight line) calculations like Pythogoras Theorem, etc, because that particular calculation is for flat space. The earth is round, so we are talking about "curved space", therefore we need to go to "geodetic geometry" for the distance calculations. This is the kind of calculations for airplane distances travelling across continents, including across the Artic Circle.
(4) Search using Google for "how to calculate distance using latitude and longitude". Ha ha ha.
http://www.gpsy.com/gpsinfo/
http://www.nhc.noaa.gov/gccalc.shtml
http://stackoverflow.com/questions/27928/how-do-i-calculate-distance-between-two-latitude-longitude-points
(5) This script (Item 6 in Javascript) calculates great-circle distances between the two points, that is, the shortest distance over the earth’s surface – using the ‘Haversine’ formula. The haversine formula is an equation important in navigation, giving great-circle distances between two points on a sphere from their longitudes and latitudes. It is a special case of a more general formula in spherical trigonometry, the law of haversines, relating the sides and angles of spherical triangles. bla bla bla. http://en.wikipedia.org/wiki/Haversine_formula . We can see many programming implementations of this calculation at this website (External Links).
(6) HAVERSINE FORMULA DISTANCE CALCULATION
function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) {
var R = 6371; // Radius of the earth in km
var dLat = deg2rad(lat2-lat1); // deg2rad below
var dLon = deg2rad(lon2-lon1);
var a =
Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) *
Math.sin(dLon/2) * Math.sin(dLon/2)
;
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c; // Distance in km
return d;
}
function deg2rad(deg) {
return deg * (Math.PI/180)
}
(7) After getting the distance calculation formula, i.e. getDistanceFromLatLonInKm(x1,y1,x2,y2), we need to VERIFY that our calculations are CORRECT using the formula.
(8) To do verification and convince the customer, we MUST demonstrate this calculation to VMS Inc and COMPARE it to some standard published distances by some authority. We can go to the table published by the authority, e.g. (lat1,lon1) London and (lat2,lon2) New York. Then the published distance between London and New York. Perform the calculation using the formula and compare it with the publish distance. Check if the numbers agreee to a certain percentage error. Ha ha ha. Do the distance calculations for a few more cities to convince the customer. He he he.
WE ARE DONE.
p.s. On this project, I actually performed those calculations using published data from Land and Survey Department Malaysia using cities like Kuala Lumpur, Shah Alam, Penang, Johor Bahru, Kuantan, Kuching, Kota Kinabalu, etc, because the Satellite Vehicle Tracking (SVT) system was meant for Malaysia. My clients were convinced. VERIFIED CORRECT. Kah kah kah.
Thank you. I rest my case.
--
WASSALAM
wruslan.hahaha
Microsoft Word Version
Return to Software Engineering Fundamentals (SEF9MMUWRY)
Previous Topic: 32 ANSWERS to Tutorial exercise for Software Design (Data Design)
Next Topic: 34 Announcement of schedule for SEF9 Quizzes
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment