Wednesday, 10 June 2009

F# for Visualization released

F# for Visualization version has just been released. This version includes a variety of enhancements.

Perhaps the most important enhancement is the introduction of dynamically typed functions scene and Typeset.math which try to build vector scenes and typeset mathematical layouts, respectively, from values of any type. The View function can be used to visualize any value of any type. For example, the following defines and then visualizes a matrix of rational numbers:

> let A =
      [ for i in 0N..4N ->
          [ for j in 0N..4N ->
              1N / (i + j + 1N) ] ];;
val A : Matrix<BigNum> = matrix [[1N; 1/2N; 1/3N; 1/4N; 1/5N]
                                 [1/2N; 1/3N; 1/4N; 1/5N; 1/6N]
                                 [1/3N; 1/4N; 1/5N; 1/6N; 1/7N]
                                 [1/4N; 1/5N; 1/6N; 1/7N; 1/8N]
                                 [1/5N; 1/6N; 1/7N; 1/8N; 1/9N]]
> View A;;

This makes it a lot easier to see what is going on during matrix computations!

Plots may now be augmented with an "epilog". For example, the following creates a graph of the sinc function:

let g = Plot([Function sinc], (-12., 12.), (-0.3, 1.1))

Accurately typeset axis labels may be added to create a professional-quality plot:

g.Labels <- (Char 'x', Row[Text "sinc"; math "(x)"])

Finally, the first positive root of this function may be highlighted by adding a single data point and a label describing the exact coordinate:

let pi = System.Math.PI
g.Data <- [Function sinc; Data[pi, 0.]]
g.Epilog <- Label(scene(Row[math "("; Greek.pi; math ", 0)"]),
                  0.003, Point(System.Math.PI, 0.), Vector(1.2, 1.2))

Axis and grid styles and the font sizes of ticks are now configurable.

Finally, the DLL is 30% smaller than before!


Anonymous said...


There used to be a free version of this? Is it no longer available? Are there any open source alternatives for those who have so money to spare on this?

Flying Frog Consultancy Ltd. said...

There are no free alternatives but we do intend to create another free edition of our commercial product.