Search:

Type: Posts; User: zesty

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    1,146

    computing the sum within a loop

    Hi, a section of my code is as follows:

    insert


    for (i = 0; i < N; i++){



    result[0] = distance(myPoints[i], myPoints[(i+1)%N]);
  2. Replies
    21
    Views
    11,212

    the first bit of my code is as follows so far: ...

    the first bit of my code is as follows so far:

    insert


    struct point{
    double x;
    double y;
    };
    typedef struct point point;
  3. Replies
    21
    Views
    11,212

    and the number of points that I am dealing with...

    and the number of points that I am dealing with will be of the order of N= 1000 say, so not very large,,
  4. Replies
    21
    Views
    11,212

    thanks everyone for all your help! sorry it has...

    thanks everyone for all your help! sorry it has taken me so long to reply..

    at the moment, i am simply looking for a computation of the order of N^2 where N is the number of points labelled...
  5. Replies
    21
    Views
    11,212

    finding nearest neighbour distance

    hi,

    my problem is as follows:

    I have a list of N pairs of coordinates labelled (x[i],y[i]) i=1,...,N.

    What I want to do is to take every point (x[i],y[i]) and find the Pythagorean distance...
  6. Replies
    14
    Views
    5,092

    yeh i managed to do that, and it works so...

    yeh i managed to do that, and it works so WOOHOO!:>..tho i used the ceiling function which worked out alrite..thankyou so much for all ur help:)..xx
  7. Replies
    14
    Views
    5,092

    yeh, it was a while loop that looks like ...

    yeh, it was a while loop that looks like



    time_increment=0.5;
    time[0]=0;
    A=1;
    w2= k/m;
    w= pow( w2, 0.5);
    p= (10*M_PI)/w;
  8. Replies
    14
    Views
    5,092

    but how would i go about doing that..it seems...

    but how would i go about doing that..it seems like a contradiction:S...my malloc looks like this



    FILE *output;
    float m, k, g, *x, *v, time_increment,*time, w2, w, p, *f, A, omega;
    int...
  9. Replies
    14
    Views
    5,092

    ok then...so i declare float *x..Then do i have...

    ok then...so i declare float *x..Then do i have to do anything with it like x=&x[0]; or *x=x[0] to get it to take it as the start of my array, or am i talking rubbish..And when would i have to use...
  10. Replies
    14
    Views
    5,092

    thanx. And i was also wondering in my programme i...

    thanx. And i was also wondering in my programme i use 4 arrays all of which i dont know the size..However, only two arrays are actually output to an external file.So would i need to use malloc on all...
  11. Replies
    14
    Views
    5,092

    but i dont understand what i would write in the...

    but i dont understand what i would write in the *fArray bit for my time array?
  12. Replies
    14
    Views
    5,092

    pointers & arrays and realloc!

    Hi..I need some help in using the realloc function in my program as the memory i need to use keeps on changing based on some parameters.Do i first have to use the malloc function and then realloc?
    ...
  13. Replies
    34
    Views
    8,464

    heyy, thanx for the replies but i wanted to write...

    heyy, thanx for the replies but i wanted to write it into my program a short piece of code that would calculate the number of lines in my output file, which varies all the time, say 'n' to then...
  14. Replies
    34
    Views
    8,464

    counting number of lines in my output file

    hey guys,

    im trying to use malloc and realloc in my programme, as the sizes of my arrays change with some parameters in my program.But to use them i need to calculate the number of lines that I...
  15. Replies
    3
    Views
    2,094

    malloc, realloc..wat on earth!

    hey guys..i need some help on understanding how to use malloc and then realloc in my programme..the sizes of my arrays are always varying based on some parameters that i have in my program, so i know...
  16. Replies
    4
    Views
    903

    while and for loops!

    ok, so basically heres my problem...in my program i have to write to my output file column of time, against x(t)..so i have to output time[i] and x[i], where
    time[0]=0 and x[0] is given by reader...
Results 1 to 16 of 16