Distribute object on a rotated sine wave line?

I have the white circle as a parent of the two-wave dotted lines
I’m trying to draw a line from the first circle to the second one and animate this line in a sine wave movement.

The code I’ve implemented works perfectly when point A and point B align along the Y-axis. However, when I rotate these two points, the dots become closer to each other and aren’t evenly distributed along the line.

If someone can help me out, I’d really appreciate it!

The code to animate and position the dots:

private Vector2 startPoint;
private Vector2 endPoint;
private List<Point> pionts = new();
private void Draw()
    var tau = 2 * Mathf.PI * frequency;
    var xStart = startPoint.x;
    var xFinish = Vector2.Distance(startPoint, endPoint);
    for (var i = 0; i < pionts.Count; i++)
        var progress = 1 - (float)i / pionts.Count;
        var x = Mathf.Lerp(xStart,xFinish, progress);
        var y = amplitude * Mathf.Sin((tau * x)  + (Time.timeSinceLevelLoad * movementYSpeed)) ;
        pionts[i].localPosition = new Vector3(x,  y);

To calculate the required number of dots:

// the sprite is squre so no diffrence if i select x or y
dotsCount = Mathf.CeilToInt(distance / spriteWidth) + 1;