Skip to content

Instantly share code, notes, and snippets.

@gunavaran
Last active October 15, 2020 11:14
Show Gist options
  • Save gunavaran/3a064da120ba1612be31bbb2e7be7d33 to your computer and use it in GitHub Desktop.
Save gunavaran/3a064da120ba1612be31bbb2e7be7d33 to your computer and use it in GitHub Desktop.
//courtesy of MIT Open Courseware (https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-172-performance-engineering-of-software-systems-fall-2018/lecture-slides/MIT6_172F18_lec2.pdf)
#include <math.h>
void orrery (){
const double radius = 6371000.0;
const double diameter = 2 * radius;
const double circumference = M_PI * diameter;
const double cross_area = M_PI * radius * radius;
const double surface_area = circumference * diameter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment