Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Length of a segment based on coordinates Post 302722119 by fadista on Friday 26th of October 2012 11:10:29 AM
Old 10-26-2012
Thanks a lot! It works.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need find a file based length

Can some please help me? Want to find files over 35 characters in length? I am running HPUX. Would it be possible with find? Thanks in advance (8 Replies)
Discussion started by: J_ang
8 Replies

2. Shell Programming and Scripting

Split strings based on length

Hi All I am very much in need of help splitting strings based on length in Perl. e.g., Input text is : International NOUN Corp. NOUN 's POS Tulsa NOUN Output I want is : International I In Int Inte l al nal onal NOUN Corp. C Co Cor Corp . p. rp. orp. NOUN... (2 Replies)
Discussion started by: my_Perl
2 Replies

3. Shell Programming and Scripting

Add character based on record length

All, I can't seem to find exactly what I'm looking for, and haven't had any luck patching things together. I need to look through a file, and if the record length is not 874, then add 'E' in position 778. Your help is greatly appreciated. (4 Replies)
Discussion started by: CutNPaste
4 Replies

4. Programming

Data segment or Text segment

Hi, Whether the following piece of code is placed in the read-only memory of code (text) segment or data segment? char *a = "Hello"; I am getting two different answers while searching in google :( that's why the confusion is (7 Replies)
Discussion started by: royalibrahim
7 Replies

5. UNIX for Dummies Questions & Answers

Sorting words based on length

i need to write a bash script that recive a list of varuables kaka pele ronaldo beckham zidane messi rivaldo gerrard platini i need the program to print the longest word of the list. word in the output appears on a separate line and word order in the output is in the order Llachsicografi costs.... (1 Reply)
Discussion started by: yairpg
1 Replies

6. Shell Programming and Scripting

Help required on Length based lookup

Hi, I have two files one (abc.txt) is having approx 28k records and another (bcd.txt) on is having 112k records, the length of each files are varried. I am trying to look up abc.txt file with bcd.txt based on length, where ever abc.txt records are matching with bcd.txt I am successful match... (8 Replies)
Discussion started by: rramkrishnas
8 Replies

7. Shell Programming and Scripting

Add string based on character length

Good day, I am a newbie here and thanks for accepting me I have a task to modify input data where my input data looks like 123|34567|CHINE 1|23|INDIA 34512|21|USA 104|901|INDIASee that my input has two columns with different character length but max length is 5 and minimum length is 0 which... (1 Reply)
Discussion started by: fastlearner
1 Replies

8. Shell Programming and Scripting

awk to adjust coordinates in field based on sequential numbers in another field

I am trying to output a tab-delimited result that uses the data from a tab-delimited file to combine and subtract specific lines. If $4 matches in each line then the first matching sequential $6 value is added to $2, unless the value is 1, then the original $2 is used (like in the case of line... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

Append 0's based on length

I'm having data like this, "8955719","186497034","0001","M","3" "8955719","186497034","0002","M","10" "8955719","186497034","0003","M","10" "8955719","186497034","0004","M","3" "8955723","186499034","0001","M","3" "8955723","186499034","0002","M","10" "8955723","186499034","0003","M","10"... (3 Replies)
Discussion started by: Artlk
3 Replies

10. Shell Programming and Scripting

Perl to adjust coordinates based on repeat string

In the file below I am trying to count the given repeats of A,T,C,G in each string of letters. Each sequence is below the > and it is possible for a string of repeats to wrap from the line above. For example, in the first line the last letter is a T and the next lines has 3 more. I think the below... (10 Replies)
Discussion started by: cmccabe
10 Replies
ARITH3(9.2)															       ARITH3(9.2)

NAME
add3, sub3, div3, mul3, eqpt3, closept3, dot3, cross3, len3, dist3, unit3, midpt3, lerp3, reflect3, nearseg3, pldist3, vdiv3, vrem3, pn2f3, ppp2f3, fff2p3, pdiv4, add4, sub4 - operations on 3-d points and planes SYNOPSIS
#include <libg.h> #include <geometry.h> Point3 add3(Point3 a, Point3 b) Point3 sub3(Point3 a, Point3 b) Point3 div3(Point3 a, double b) Point3 mul3(Point3 a, double b) int eqpt3(Point3 p, Point3 q) int closept3(Point3 p, Point3 q, double eps) double dot3(Point3 p, Point3 q) Point3 cross3(Point3 p, Point3 q) double len3(Point3 p) double dist3(Point3 p, Point3 q) Point3 unit3(Point3 p) Point3 midpt3(Point3 p, Point3 q) Point3 lerp3(Point3 p, Point3 q, double alpha) Point3 reflect3(Point3 p, Point3 p0, Point3 p1) Point3 nearseg3(Point3 p0, Point3 p1, Point3 testp) double pldist3(Point3 p, Point3 p0, Point3 p1) double vdiv3(Point3 a, Point3 b) Point3 vrem3(Point3 a, Point3 b) Point3 pn2f3(Point3 p, Point3 n) Point3 ppp2f3(Point3 p0, Point3 p1, Point3 p2) Point3 fff2p3(Point3 f0, Point3 f1, Point3 f2) Point3 pdiv4(Point3 a) Point3 add4(Point3 a, Point3 b) Point3 sub4(Point3 a, Point3 b) DESCRIPTION
These routines do arithmetic on points and planes in affine or projective 3-space. Type Point3 is typedef struct Point3 Point3; struct Point3{ double x, y, z, w; }; Routines whose names end in 3 operate on vectors or ordinary points in affine 3-space, represented by their Euclidean (x,y,z) coordinates. (They assume w=1 in their arguments, and set w=1 in their results.) Name Description add3 Add the coordinates of two points. sub3 Subtract coordinates of two points. mul3 Multiply coordinates by a scalar. div3 Divide coordinates by a scalar. eqpt3 Test two points for exact equality. closept3 Is the distance between two points smaller than eps? dot3 Dot product. cross3 Cross product. len3 Distance to the origin. dist3 Distance between two points. unit3 A unit vector parallel to p. midpt3 The midpoint of line segment pq. lerp3 Linear interpolation between p and q. reflect3 The reflection of point p in the segment joining p0 and p1. nearseg3 The closest point to testp on segment p0 p1. pldist3 The distance from p to segment p0 p1. vdiv3 Vector divide -- the length of the component of a parallel to b, in units of the length of b. vrem3 Vector remainder -- the component of a perpendicular to b. Ignoring roundoff, we have eqpt3(add3(mul3(b, vdiv3(a, b)), vrem3(a, b)), a). The following routines convert amongst various representations of points and planes. Planes are represented identically to points, by duality; a point p is on a plane q whenever p.x*q.x+p.y*q.y+p.z*q.z+p.w*q.w=0. Although when dealing with affine points we assume p.w=1, we can't make the same assumption for planes. The names of these routines are extra-cryptic. They contain an f (for `face') to indicate a plane, p for a point and n for a normal vector. The number 2 abbreviates the word `to.' The number 3 reminds us, as before, that we're dealing with affine points. Thus pn2f3 takes a point and a normal vector and returns the corresponding plane. Name Description pn2f3 Compute the plane passing through p with normal n. ppp2f3 Compute the plane passing through three points. fff2p3 Compute the intersection point of three planes. The names of the following routines end in 4 because they operate on points in projective 4-space, represented by their homogeneous coordi- nates. pdiv4 Perspective division. Divide p.w into p's coordinates, converting to affine coordinates. If p.w is zero, the result is the same as the argument. add4 Add the coordinates of two points. sub4 Subtract the coordinates of two points. SOURCE
/sys/src/libgeometry SEE ALSO
tstack(9.2) BUGS
Spotty coverage. ARITH3(9.2)
All times are GMT -4. The time now is 05:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy