Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Get the shortest distance from a point to a line segment.

This can either be a perpendicular to a point on the line segment or the straight connection of p to one of the end points.

@type p: Vector
@param p: The point to compare to the line segment

@type a: Vector
@param a: The first point on the first line segment
(more...)

src/p/y/Py2D-HEAD/py2d/FOV.py   Py2D(Download)
		def sub_segment(small, big):
			return py2d.Math.distance_point_lineseg_squared(small[0], big[0], big[1]) < 0.0001 and py2d.Math.distance_point_lineseg_squared(small[1], big[0], big[1]) < 0.0001
 
 
		def segment_in_obs(seg):
		def lineseg_in_radius(seg):
			return py2d.Math.distance_point_lineseg_squared(eye, seg[0], seg[1]) <= radius_squared
 
		obs_segs = filter(lineseg_in_radius, self.obs_segs)
 
				p = boundary_intersection_points[i]
 
				if py2d.Math.distance_point_lineseg_squared(p, line_segment[0], line_segment[1]) > 0.0001 and py2d.Math.check_intersect_lineseg_lineseg(eye, p, line_segment[0], line_segment[1]):
					boundary_intersection_points.remove(p)
				else: