# SML# - VariantSource Diff

- Added parts are displayed like this.
- Deleted parts are displayed
~~like this~~.

val sqrt = Real.Math.sqrt ;

val P1 = fn M => #CPoint M {x=10.0, y = 10.0};

val P2 = fn M => #PPoint M {r=14.1421356, theta = 45.0 };

val myPointList = [P1, P2];

val distance =

{CPoint = fn {x,y} => sqrt (x *x + y* y),

PPoint = fn {r, theta} => r};

val angle =

{CPoint = fn {x,y} => (Math.atan (x / y) / Math.pi) * 180.0,

PPoint = fn {r, theta} => theta};

P1 distance ;

P2 distance ;

P1 angle ;

P2 angle ;

fun iterator L f = map (fn x => x f) L;

val myPointLstIter = fn x => iterator myPointList x;

myPointLstIter distance;

myPointLstIter angle;

val P1 = fn M => #CPoint M {x=10.0, y = 10.0};

val P2 = fn M => #PPoint M {r=14.1421356, theta = 45.0 };

val myPointList = [P1, P2];

val distance =

{CPoint = fn {x,y} => sqrt (x *x + y* y),

PPoint = fn {r, theta} => r};

val angle =

{CPoint = fn {x,y} => (Math.atan (x / y) / Math.pi) * 180.0,

PPoint = fn {r, theta} => theta};

P1 distance ;

P2 distance ;

P1 angle ;

P2 angle ;

fun iterator L f = map (fn x => x f) L;

val myPointLstIter = fn x => iterator myPointList x;

myPointLstIter distance;

myPointLstIter angle;