private PointMagnet addPerpendicularMagnet(LineMagnet lm, PointMagnet pm, float lmDot, GraphicView activeView, System.Windows.Forms.MouseEventArgs e)
{
float r = Vector3.Dot(lm.Direction, pm.Position - lm.Position) / lmDot;
PointMagnet perpPtMagnet = new PointMagnet(lm.Position + Vector3.Scale(lm.Direction, r),
PointMagnetType.Perpendicular);
if (perpPtMagnet.Snap(activeView, e.Location) < SnapViewDistance)
{
perpPtMagnet.RelatedMagnets.Add(pm);
perpPtMagnet.RelatedMagnets.Add(lm);
points.Add(perpPtMagnet);
return perpPtMagnet;
}
return null;
}