Exemple #1
0
func (s *segment) shiftBy(v vector.V2) *segment {
	dprintf("shifting by %v", v)
	s.from = Vertex2(vector.V2(s.from).Add(v))
	s.to = Vertex2(vector.V2(s.to).Add(v))
	s.line = nil
	return s
}
Exemple #2
0
func (v1 Vertex2) distFrom(v2 Vertex2) float64 {
	v := vector.V2(v2).Sub(vector.V2(v1))
	return v.Length()
}