def to_measure(self) :
"""
Outputs the sum-of-diracs measure associated to the curve.
Each segment from the connectivity matrix self.c
is represented as a weighted dirac located at its center,
with weight equal to the segment length.
"""
segments = self.segments()
centers = [ .5 * ( seg[0] + seg[1] ) for seg in segments ]
lengths = [np.sqrt(np.sum( (seg[1] - seg[0])**2 )) for seg in segments ]
return ( np.array(centers), np.array(lengths) )
评论列表
文章目录