Question
This is for C++. The assignment is to write a program which can draw a top-down view of a portion of the surface of Mars,
This is for C++. The assignment is to write a program which can draw a top-down view of a portion of the surface of Mars, and using a digital elevation map of the same portion of Mars, overlay elevation data on it. A PGM image covering the entire surface of Mars, and an elevation map of Mars are provided below in links to files that can be downloaded to accomplish this task.
A complete solution will scale the image properly to correct for latitude stretching in the original PGM, and draw contour lines on resulting image using elevation data from the EGM file. Alternately, for a lower grade, the solution can simply identify the highest elevation and lowest elevation points in the image by drawing a small circle over those points. Similarly, for a lower grade, the program can skip the longitude correction, in which case the resulting image will be distorted horizontally, so that craters which are circular on the surface will appear wider horizontally because of the 1/cos(latitude) stretching that occurs in the original files.
Your program should prompt the user for a rectangular latitude and longitude region to extract from the PGM and EGM files (i.e., prompt for upper left and lower right lat & lon coordinates). It should read and extract that portion of the two files and produce a PGM image from the combined data. A complete solution will overlay contour lines from the elevation data using information from the EGM elevation file, but a simpler solution can simply find the maximum and minimum elevation points and draw a circle around them on the output image. The resulting image should be written to a PGM file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started