diff options
Diffstat (limited to 'bin/main.ml')
| -rw-r--r-- | bin/main.ml | 36 | 
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/main.ml b/bin/main.ml new file mode 100644 index 0000000..0767aa7 --- /dev/null +++ b/bin/main.ml @@ -0,0 +1,36 @@ +(* Main function to plot the coordinates *) + +let airfoil_plot naca_num = +  (* let filename = Printf.sprintf "static/airfoil-%s.svg" naca_num in *) +  let open Naca in +  (* Initialize plplot *) +  Plplot.plsdev "xwin"; +  (* Plplot.plsfnam filename; *) +  Plplot.plinit (); +  Plplot.plenv (-0.2) 1.2 (-0.3) 0.3 1 0; + +  (* Set the labels *) +  let x_label = "relative x" in +  let y_label = "y_t" in +  let title = +    Printf.sprintf "NACA %s Airfoil Thickness Distribution" naca_num +  in +  Plplot.pllab x_label y_label title; +  Naca4.plot_airfoil naca_num ~amt:10 (); + +  (* End the plot *) +  Plplot.plend () +  (* filename *) + +(* let main_page naca_num = *) +(*   let file = airfoil_plot naca_num in *) +(*   "Hello world!" ^ Printf.sprintf "<img src='%s' alt=''>" file *) + +let () = +  airfoil_plot "4412" +  (* Dream.run @@ Dream.logger *) +  (* @@ Dream.router *) +  (*      [ *) +  (*        Dream.get "/" (fun _ -> Dream.html @@ main_page "9412"); *) +  (*        Dream.get "/static/**" (Dream.static "static"); *) +  (*      ] *)  |