Skip to content

Instantly share code, notes, and snippets.

@Sfshaza
Created February 9, 2016 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sfshaza/7a9764702c0608711e08 to your computer and use it in GitHub Desktop.
Save Sfshaza/7a9764702c0608711e08 to your computer and use it in GitHub Desktop.
ch02
import 'dart:math';
class Point {
final num x;
final num y;
final num distanceFromOrigin;
Point(x, y)
: x = x,
y = y,
distanceFromOrigin = sqrt(x * x + y * y);
}
main() {
var p = new Point(2, 3);
print(p.distanceFromOrigin);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment