Hi all,
I have a tcl/tk programming error. I have some experience in programming tcl/tk but this is very basic.
My problem is the following:
I have a .dat file with varying entries. In general the file looks as follows:
NACA6409 9%
1.00000 0.00000
0.99732 0.00084
0.98930 0.00333
0.97603 0.00737
0.95760 0.01284
0.93423 0.01954
0.90615 0.02724
0.87357 0.03571
0.83690 0.04464
0.79647 0.05378
0.75272 0.06283
0.70608 0.07153
0.65710 0.07961
0.60627 0.08684
0.55413 0.09302
0.50132 0.09796
0.44840 0.10152
0.39590 0.10360
0.34367 0.10352
0.29315 0.10086
0.24502 0.09584
0.19988 0.08874
0.15830 0.07992
0.12080 0.06982
0.08780 0.05889
0.05968 0.04762
0.03677 0.03646
0.01920 0.02581
0.00720 0.01603
0.00080 0.00737
0.00000 0.00000
0.00467 -0.00573
0.01467 -0.00956
0.02973 -0.01157
0.04970 -0.01192
0.07428 -0.01080
0.10317 -0.00844
0.13607 -0.00513
0.17257 -0.00119
0.21235 0.00307
0.25498 0.00729
0.30012 0.01112
0.34730 0.01425
0.39618 0.01639
0.44707 0.01772
0.49868 0.01871
0.55040 0.01925
0.60167 0.01929
0.65193 0.01880
0.70065 0.01780
0.74728 0.01634
0.79130 0.01451
0.83223 0.01241
0.86957 0.01017
0.90288 0.00791
0.93180 0.00576
0.95593 0.00383
0.97503 0.00221
0.98883 0.00101
0.99722 0.00025
1.00000 0.00000
The first column are the x coordinates, the second are z coordinates of an airfoil.
I would like to know at which line(s) the nearest value of x=0.25 can be found.
So for this input file the result should be the line numbers of x=0.24502 and x=0.25498 since these are the closest values to x=0.25.
I suppose this needs to be done in two steps.
The first step, splitting the first column into two parts.
The second to search for both results.
Does anyone of you guys know how to program this in tcl/tk?
If my problem description is not clear, let me know I'll try to be more specific.
Thanks a lot!!!
I have a tcl/tk programming error. I have some experience in programming tcl/tk but this is very basic.
My problem is the following:
I have a .dat file with varying entries. In general the file looks as follows:
NACA6409 9%
1.00000 0.00000
0.99732 0.00084
0.98930 0.00333
0.97603 0.00737
0.95760 0.01284
0.93423 0.01954
0.90615 0.02724
0.87357 0.03571
0.83690 0.04464
0.79647 0.05378
0.75272 0.06283
0.70608 0.07153
0.65710 0.07961
0.60627 0.08684
0.55413 0.09302
0.50132 0.09796
0.44840 0.10152
0.39590 0.10360
0.34367 0.10352
0.29315 0.10086
0.24502 0.09584
0.19988 0.08874
0.15830 0.07992
0.12080 0.06982
0.08780 0.05889
0.05968 0.04762
0.03677 0.03646
0.01920 0.02581
0.00720 0.01603
0.00080 0.00737
0.00000 0.00000
0.00467 -0.00573
0.01467 -0.00956
0.02973 -0.01157
0.04970 -0.01192
0.07428 -0.01080
0.10317 -0.00844
0.13607 -0.00513
0.17257 -0.00119
0.21235 0.00307
0.25498 0.00729
0.30012 0.01112
0.34730 0.01425
0.39618 0.01639
0.44707 0.01772
0.49868 0.01871
0.55040 0.01925
0.60167 0.01929
0.65193 0.01880
0.70065 0.01780
0.74728 0.01634
0.79130 0.01451
0.83223 0.01241
0.86957 0.01017
0.90288 0.00791
0.93180 0.00576
0.95593 0.00383
0.97503 0.00221
0.98883 0.00101
0.99722 0.00025
1.00000 0.00000
The first column are the x coordinates, the second are z coordinates of an airfoil.
I would like to know at which line(s) the nearest value of x=0.25 can be found.
So for this input file the result should be the line numbers of x=0.24502 and x=0.25498 since these are the closest values to x=0.25.
I suppose this needs to be done in two steps.
The first step, splitting the first column into two parts.
The second to search for both results.
Does anyone of you guys know how to program this in tcl/tk?
If my problem description is not clear, let me know I'll try to be more specific.
Thanks a lot!!!