Skip to content

Instantly share code, notes, and snippets.

@jcbozonier
Created December 3, 2008 05:27
Show Gist options
  • Save jcbozonier/31421 to your computer and use it in GitHub Desktop.
Save jcbozonier/31421 to your computer and use it in GitHub Desktop.
#light
open Microsoft.FSharp.Math
// [|Ambiance; Graphics; Sound; Creative; Fun; Worth|]
let FableII = 3., 7., 7., 7., 10., 9.
let FarCryII = 5., 8., 5., 1., 5., 9.
let DeadSpace = 9., 9., 9., 8., 4., 9.
let JustinExpectations = 5., 8., 3., 8., 8., 6.
let JustinDeadSpaceExpectations = 10., 10., 8., 9., 7., 10.
let SanityCheck = 1., 0., 0., 0., 0., 0.
let dot (a1 : float,a2,a3,a4,a5,a6) (b1,b2,b3,b4,b5,b6) = a1 * b1 + a2 * b2 + a3 * b3 + a4 * b4 + a5 * b5 + a6*b6
let magnitude (a1,a2,a3,a4,a5,a6) =
System.Math.Sqrt(
System.Math.Pow(a1, 2.) +
System.Math.Pow(a2, 2.) +
System.Math.Pow(a3, 2.) +
System.Math.Pow(a4, 2.) +
System.Math.Pow(a5, 2.) +
System.Math.Pow(a6, 2.))
let similar x y =
System.Math.Acos((dot x y)/((magnitude x) * (magnitude y)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment