Determination n points between two coordinates


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Determination n points between two coordinates
# 1  
Old 09-20-2011
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
# 2  
Old 09-20-2011
what's the formula?
# 3  
Old 09-20-2011
If it has to be command line then, assuming a straight line:

Code:
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
$

This User Gave Thanks to Corona688 For This Post:
# 4  
Old 09-20-2011
Quote:
Originally Posted by vgersh99
what's the formula?
no formula. We have just two points and need the points among these.
# 5  
Old 09-20-2011
Quote:
Originally Posted by rpf
no formula. We have just two points and need the points among these.
oh, I thought you meant distance between 2 points, sorry!
This User Gave Thanks to vgersh99 For This Post:
# 6  
Old 09-20-2011
thank you for your time, it works perfect...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with identify gradient and the coefficient of determination of a straight line

Hi, Do anybody experience using awk or perl command to identify gradient of a straight line and The coefficient of determination/R-square value of a chart (R2) ? Below is my input file : t1 2 3 5 8 t2 0 2 0 2 t3 1 1 1 1 t4 50 70 80 90 . . . Desired Output : t1 2 3 5 8 0.6986... (10 Replies)
Discussion started by: perl_beginner
10 Replies

2. Shell Programming and Scripting

Reducing the decimal points of numbers (3d coordinates) in a file; how to input data to e.g. Python

I have a file full of coordinates of the form: 37.68899917602539 58.07500076293945 57.79100036621094 The numbers don't always have the same number of decimal points. I need to reduce the decimal points of all the numbers (there are 128 rows of 3 numbers) to 2. I have tried to do this... (2 Replies)
Discussion started by: crunchgargoyle
2 Replies

3. UNIX for Dummies Questions & Answers

overlapped genomic coordinates

Hi, I would like to know how can I get the ID of a feature if its genomic coordinates overlap the coordinates of another file. Example: Get the 4th column (ID) of this file1: chr1 10 100 gene1 chr2 3000 5000 gene2 chr3 200 1500 gene3 if it overlaps with a feature in this file2: chr2... (1 Reply)
Discussion started by: fadista
1 Replies

4. Programming

PL/SQL Determine if the coordinates of a point is within four points

Dear all, Given that the coordinates of 4 points such as c1(x1,y1), c2(x2,y2), c3(x3,y3), c4(x4,y4). Does any body know how to use plain sql / plsql to determine coordinates of a point e.g. (x,y) is within 4 points above efficiently. The 4 points supposedly form a rectangle rectangular. ... (0 Replies)
Discussion started by: eldonlck
0 Replies

5. Shell Programming and Scripting

loop for determination of number of points in a enclosed area

Hi Friends, I am trying to find coordinates within three points by using a for loop. For example: I want to find points within the triangular area enclosed by (1,2,3), (4,5,6) and (7,8,9) points. I want to create a mesh in a triangle and I should know the coordinates of points. Best... (4 Replies)
Discussion started by: rpf
4 Replies

6. Red Hat

Total space Determination

Hi experts, # df -h Filesystem Size Used Avail Use% Mounted on /dev/hda9 3.8G 1.7G 2.0G 46% / none 369M 0 369M 0% /dev/shm /dev/hda10 2.0G 33M 1.8G 2% /tmp /dev/hda12 1.4G 1.2G 260M 82% /usr I used df -h... (3 Replies)
Discussion started by: William1482
3 Replies

7. UNIX for Dummies Questions & Answers

mth code determination

FILE_DATE=`date +%Y%m%d` current mth code is 200808 How can i find the 56 mths back mth code. (1 Reply)
Discussion started by: dr46014
1 Replies

8. UNIX and Linux Applications

Gnuplot question: how to plot 3D points as colored points in map view?

I have a simple gnuplot question. I have a set of points (list of x,y,z values; irregularly spaced, i.e. no grid) that I want to plot. I want the plot to look like this: - points in map view (no 3D view) - color of each point should depend on its z-value. - I want to define my own color scale -... (0 Replies)
Discussion started by: karman
0 Replies

9. Programming

Telnet client IP determination

I have configured my firewall to allow only five remote IP's to connect to my server. Upon connection...i would like to automate the Xsession functions for authorized IP's. Mainly, $DISPLAY of the environment to the client. I understand that the "gethostbyaddr" function is capable of this.... (0 Replies)
Discussion started by: thomas.jones
0 Replies

10. UNIX for Dummies Questions & Answers

Hardware Determination

Does anyone know an equiv of lscfg -vp for HP-UX? (2 Replies)
Discussion started by: sam_pointer
2 Replies
Login or Register to Ask a Question