DPSF by Daniel Schroeder

<PackageReference Include="DPSF" Version="2.5.0" />

.NET API 168,448 bytes

 MagnetLine

Magnet that attracts particles to/from an infinite line in 3D space
public Vector3 Direction { get; set; }

The direction that the Line points in. This direction, along with the opposite (i.e. negative) of this direction form the line, since a line has infinite length. This value is automatically normalized when it is set.

public Vector3 PositionOnLine { get; set; }

A 3D point that the Line passes through

public MagnetLine(Vector3 sPositionOnLine, Vector3 sDirection, MagnetModes eMode, DistanceFunctions eDistanceFunction, float fMinDistance, float fMaxDistance, float fMaxForce, int iType)

Explicit Constructor

public MagnetLine(MagnetLine cMagnetToCopy)

Copy Constructor

public void CopyFrom(MagnetLine cMagnetToCopy)

Copies the given Line Magnet's data into this Line Magnet's data

public void SetDirection(Vector3 sFirstPointOnTheLine, Vector3 sSecondPointOnTheLine)

Sets the Direction of the Line by specifying 2 points in 3D space that are on the Line.

NOTE: The 2 points cannot be the same.