Skip to content

Instantly share code, notes, and snippets.

@cshaa
Created February 28, 2017 15:40
Show Gist options
  • Select an option

  • Save cshaa/d10a3eced8bc0605f94bc4ad44a461b8 to your computer and use it in GitHub Desktop.

Select an option

Save cshaa/d10a3eced8bc0605f94bc4ad44a461b8 to your computer and use it in GitHub Desktop.
This computes the radius of a LV Haack nose cone at each point
function LVHaack(n){
n=+n;
with(Math){
return sqrt( 1/PI * ( acos(1-n/12) - 0.5*sin(2*acos(1-n/12)) + (1/3)*pow(sin(acos(1-n/12)),3) ) )
}
}
/* For LD Haack change `(1/3)*pow` to `0*pow`,
for tangent Haack change it to `(2/3)*pow` */
for(var i=0; i<=24; i++){
console.log( LVHaack(i).toFixed(4) )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment