Results 1 to 2 of 2

Math Help - Plotting multiple circles in Octave from arrays

  1. #1
    Newbie
    Joined
    Jan 2010
    Posts
    6

    Plotting multiple circles in Octave from arrays

    Hi,

    I've basically exhausted myself trying to use Octave to plot a number of circles on the same graph. I've written code in C that outputs a file with three columns:

    1) x coordinate of centre of circle
    2) y coordinate of centre of circle
    3) radius of circle.

    There are approximately 30~35 circles to be plotted in each graph.

    For example, the file might read in:

    0 0.125000 0.125000 0.050000
    1 0.050000 0.300000 0.050000
    2 0.375000 0.125000 0.125000
    3 0.050000 0.400000 0.050000
    4 0.375000 0.375000 0.125000
    5 0.125000 0.575000 0.125000
    6 0.050000 0.750000 0.050000
    7 0.150000 0.300000 0.050000
    8 0.375000 0.625000 0.125000
    9 0.625000 0.125000 0.050000
    10 0.375000 0.875000 0.125000
    11 0.150000 0.400000 0.125000
    12 0.625000 0.375000 0.050000
    13 0.150000 0.750000 0.050000
    14 0.625000 0.625000 0.125000
    15 0.875000 0.375000 0.125000
    16 0.625000 0.875000 0.125000
    17 0.050000 0.850000 0.125000
    18 0.875000 0.875000 0.125000
    19 0.875000 0.625000 0.125000
    20 0.875000 0.125000 0.050000
    22 0.150000 0.850000 0.050000
    23 0.050000 0.950000 0.050000
    26 0.250000 0.750000 0.050000
    28 0.150000 0.950000 0.050000

    Thing is, I need to do this for a variety of different parameters.

    I know that in order to plot it implicitly i need something like:

    t=0.01:0.01:2*pi

    x = sqrt(r)*cos(t)+x_0
    y = sqrt(r)*cos(t)+y_0

    but the problem comes when defining x,y and then plotting them. Argh! Can anyone please help me write a little script to plot all these on the same graph please? I'd be forever indebted.

    RH
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by redherring View Post
    Hi,

    I've basically exhausted myself trying to use Octave to plot a number of circles on the same graph. I've written code in C that outputs a file with three columns:

    1) x coordinate of centre of circle
    2) y coordinate of centre of circle
    3) radius of circle.

    There are approximately 30~35 circles to be plotted in each graph.

    For example, the file might read in:

    0 0.125000 0.125000 0.050000
    1 0.050000 0.300000 0.050000
    2 0.375000 0.125000 0.125000
    3 0.050000 0.400000 0.050000
    4 0.375000 0.375000 0.125000
    5 0.125000 0.575000 0.125000
    6 0.050000 0.750000 0.050000
    7 0.150000 0.300000 0.050000
    8 0.375000 0.625000 0.125000
    9 0.625000 0.125000 0.050000
    10 0.375000 0.875000 0.125000
    11 0.150000 0.400000 0.125000
    12 0.625000 0.375000 0.050000
    13 0.150000 0.750000 0.050000
    14 0.625000 0.625000 0.125000
    15 0.875000 0.375000 0.125000
    16 0.625000 0.875000 0.125000
    17 0.050000 0.850000 0.125000
    18 0.875000 0.875000 0.125000
    19 0.875000 0.625000 0.125000
    20 0.875000 0.125000 0.050000
    22 0.150000 0.850000 0.050000
    23 0.050000 0.950000 0.050000
    26 0.250000 0.750000 0.050000
    28 0.150000 0.950000 0.050000

    Thing is, I need to do this for a variety of different parameters.

    I know that in order to plot it implicitly i need something like:

    t=0.01:0.01:2*pi

    x = sqrt(r)*cos(t)+x_0
    y = sqrt(r)*cos(t)+y_0

    but the problem comes when defining x,y and then plotting them. Argh! Can anyone please help me write a little script to plot all these on the same graph please? I'd be forever indebted.

    RH
    For starters

    x=r*cos(t)+x0
    y=r*sin(t)+x0

    plot(x,y)

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Using imagesc to visualize arrays in Octave
    Posted in the Math Software Forum
    Replies: 0
    Last Post: September 13th 2011, 10:54 PM
  2. Plotting "Continuous" Histograms in Octave/Matlab
    Posted in the Math Software Forum
    Replies: 6
    Last Post: August 13th 2010, 11:46 PM
  3. Matlab - Plotting Circles
    Posted in the Math Software Forum
    Replies: 1
    Last Post: February 16th 2009, 09:28 AM
  4. Creating and plotting multiple lists
    Posted in the Math Software Forum
    Replies: 1
    Last Post: October 9th 2008, 04:34 PM
  5. [SOLVED] The total area of multiple circles
    Posted in the Geometry Forum
    Replies: 1
    Last Post: January 22nd 2008, 07:02 PM

Search Tags


/mathhelpforum @mathhelpforum