Determination n points between two coordinates

Hi guys. Can anyone tell me how to determine points between two coardinates. For example: Which type of command line gives me

50 points between (8, -5, 7) and (2, 6, 9) points

Thanks

what's the formula?

If it has to be command line then, assuming a straight line:

echo "50 8 -5 7 2 6 9" | awk '{
    for(M=2; M<=4; M++) D[M]=$(M+3)-$M

    for(N=0; N<$1; N++)
    {
        for(M=2; M<=4; M++)
            printf(" %.2f", $M + ((N*D[M])/($1-1)));

        printf("\n");
    } }'
 8.00 -5.00 7.00
 7.88 -4.78 7.04
 7.76 -4.55 7.08
 7.63 -4.33 7.12
 7.51 -4.10 7.16
 7.39 -3.88 7.20
 7.27 -3.65 7.24
 7.14 -3.43 7.29
 7.02 -3.20 7.33
 6.90 -2.98 7.37
 6.78 -2.76 7.41
 6.65 -2.53 7.45
 6.53 -2.31 7.49
 6.41 -2.08 7.53
 6.29 -1.86 7.57
 6.16 -1.63 7.61
 6.04 -1.41 7.65
 5.92 -1.18 7.69
 5.80 -0.96 7.73
 5.67 -0.73 7.78
 5.55 -0.51 7.82
 5.43 -0.29 7.86
 5.31 -0.06 7.90
 5.18 0.16 7.94
 5.06 0.39 7.98
 4.94 0.61 8.02
 4.82 0.84 8.06
 4.69 1.06 8.10
 4.57 1.29 8.14
 4.45 1.51 8.18
 4.33 1.73 8.22
 4.20 1.96 8.27
 4.08 2.18 8.31
 3.96 2.41 8.35
 3.84 2.63 8.39
 3.71 2.86 8.43
 3.59 3.08 8.47
 3.47 3.31 8.51
 3.35 3.53 8.55
 3.22 3.76 8.59
 3.10 3.98 8.63
 2.98 4.20 8.67
 2.86 4.43 8.71
 2.73 4.65 8.76
 2.61 4.88 8.80
 2.49 5.10 8.84
 2.37 5.33 8.88
 2.24 5.55 8.92
 2.12 5.78 8.96
 2.00 6.00 9.00
$
1 Like

no formula. We have just two points and need the points among these.

oh, I thought you meant distance between 2 points, sorry!

1 Like

thank you for your time, it works perfect...