Mercurial Hosting > traffic-intelligence
view python/tests/utils.txt @ 38:0d321c23d337
added norm functions for Point and accessor methods for MovingObject
author | Nicolas Saunier <nico@confins.net> |
---|---|
date | Tue, 18 May 2010 17:35:09 -0400 |
parents | 48e56179c39e |
children | 1a2ac2d4f53a |
line wrap: on
line source
>>> from utils import * >>> from moving import Point >>> computeChi2([],[]) 0.0 >>> computeChi2(range(1,10),range(1,10)) 0.0 >>> computeChi2(range(1,9),range(1,10)) 0.0 >>> ceilDecimals(1.23, 0) 2.0 >>> ceilDecimals(1.23, 1) 1.3 >>> segmentIntersection(Point(0,0),Point(1,1), Point(0,1), Point(1,2)) >>> segmentIntersection(Point(0,1),Point(1,0), Point(0,2), Point(2,1)) >>> segmentIntersection(Point(0,0),Point(2,0), Point(1,-1),Point(1,1)) (1.000000,0.000000) >>> segmentIntersection(Point(0,1),Point(2,0),Point(1,1),Point(1,2)) >>> f = openCheck('non_existant_file.txt') File non_existant_file.txt could not be opened. >>> removeExtension('test-adfasdf.asdfa.txt') 'test-adfasdf.asdfa' >>> removeExtension('test-adfasdf') 'test-adfasdf'