Re: [PD] Graph a circle arc in an array?
I've not had any real success using the formulas with [sin] and [cos]... maybe I'm missing something here. The only solution that I've gotten to work is the midpoint circle algorithm with Peter's patch. I've included a patch to show where I'm struggling... When the arc gets drawn with bigger radiuses (and bigger arrays) there are a lot of indexes with no value so it's constantly jumping between 0 and the correct value. Is there a way to get pd to approximate the values in between (more or less an average between plotted points)? Thanks so far for all the help Tyler On Fri, Apr 8, 2011 at 11:12 PM, Mathieu Bouchard ma...@artengine.cawrote: On Fri, 8 Apr 2011, Tyler Leavitt wrote: I am trying to graph a section of a circle into an array. I have been trying to wrap my head around [sin] and [cos] but none of my configurations get results. If you had a circle with radius 100 with a center at (0, 0) I'm trying to get the upper right quadrant (positive x and positive y). The start point being (100,0) and the end point being (0,100). Any ideas on moving forward? use angles between 0 and pi/2 = 1.5708 putting those into [cos] and [sin] will give you values for a circle of radius 1 at (0,0). For different radiuses you apply [*] after that. quadrants and clockwiseness depend on which axis uses [cos], which axis uses [sin], and which direction of each axis is positive. There are several standards for those things. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Graph a circle arc in an array?
Ok well now I have really attached the patch... On Sun, Apr 10, 2011 at 7:12 AM, Tyler Leavitt thecryofl...@gmail.comwrote: I've not had any real success using the formulas with [sin] and [cos]... maybe I'm missing something here. The only solution that I've gotten to work is the midpoint circle algorithm with Peter's patch. I've included a patch to show where I'm struggling... When the arc gets drawn with bigger radiuses (and bigger arrays) there are a lot of indexes with no value so it's constantly jumping between 0 and the correct value. Is there a way to get pd to approximate the values in between (more or less an average between plotted points)? Thanks so far for all the help Tyler On Fri, Apr 8, 2011 at 11:12 PM, Mathieu Bouchard ma...@artengine.cawrote: On Fri, 8 Apr 2011, Tyler Leavitt wrote: I am trying to graph a section of a circle into an array. I have been trying to wrap my head around [sin] and [cos] but none of my configurations get results. If you had a circle with radius 100 with a center at (0, 0) I'm trying to get the upper right quadrant (positive x and positive y). The start point being (100,0) and the end point being (0,100). Any ideas on moving forward? use angles between 0 and pi/2 = 1.5708 putting those into [cos] and [sin] will give you values for a circle of radius 1 at (0,0). For different radiuses you apply [*] after that. quadrants and clockwiseness depend on which axis uses [cos], which axis uses [sin], and which direction of each axis is positive. There are several standards for those things. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC #N canvas 0 0 1440 816 10; #X obj 171 35 tabwrite array1; #X obj 31 -34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 0 0 450 300 (subpatch) 0; #X array array1 1000 float 3; #A 0 1000 -1.11659e-06 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 999.848 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 999.391 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 998.63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 997.564 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 996.195 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 994.522 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 992.546 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 990.268 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 987.688 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 984.808 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 981.627 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 978.148 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 974.37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 970.296 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 965.926 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 961.262 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 956.305 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 951.056 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 945.518 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 939.693 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 933.58 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 927.184 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 920.505 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 913.545 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 906.308 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 898.794 0 0 0 0 0 0 0 0 0 0 0 0 0 0 891.006 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 882.947 0 0 0 0 0 0 0 0 0 0 0 0 0 0 874.62 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 866.025 0 0 0 0 0 0 0 0 0 0 0 0 0 0 857.167 0 0 0 0 0 0 0 0 0 0 0 0 0 848.048 0 0 0 0 0 0 0 0 0 0 0 0 0 0 838.67 0 0 0 0 0 0 0 0 0 0 0 0 0 0 829.037 0 0 0 0 0 0 0 0 0 0 0 0 0 819.152 0 0 0 0 0 0 0 0 0 0 0 0 0 809.017 0 0 0 0 0 0 0 0 0 0 0 0 0 798.635 0 0 0 0 0 0 0 0 0 0 0 0 0 788.01 0 0 0 0 0 0 0 0 0 0 0 0 0 777.146 0 0 0 0 0 0 0 0 0 0 0 0 766.044 0 0 0 0 0 0 0 0 0 0 0 0 0 754.709 0 0 0 0 0 0 0 0 0 0 0 0 743.145 0 0 0 0 0 0 0 0 0 0 0 731.353 0 0 0 0 0 0 0 0 0 0 0 0 719.339 0 0 0 0 0 0 0 0 0 0 0 0 707.106 0 0 0 0 0 0 0 0 0 0 0 694.658 0 0 0 0 0 0 0 0 0 0 0 681.998 0 0 0 0 0 0 0 0 0 0 0 669.13 0 0 0 0 0 0 0 0 0 0 656.059 0 0 0 0 0 0 0 0 0 0 0 642.787 0 0 0 0 0 0 0 0 0 0 629.32 0 0 0 0 0 0 0 0 0 0 615.661 0 0 0 0 0 0 0 0 0 601.815 0 0 0 0 0 0 0 0 0 0 587.785 0 0 0 0 0 0 0 0 0 573.576 0 0 0 0 0 0 0 0 0 559.192 0 0 0 0 0 0 0 0 544.638 0 0 0 0 0 0 0 0 0 529.919 0 0 0 0 0 0 0 0 515.037 0 0 0 0 0 0 0 0 499.999 0 0 0 0 0 0 0 484.809 0 0 0 0 0 0 0 469.471 0 0 0 0 0 0 0 0 453.99 0 0 0 0 0 0 438.37 0 0 0 0 0 0 0 422.618 0 0 0 0 0 0 406.736 0 0 0 0 0 0 390.73 0 0 0 0 0 0 374.606 0 0 0 0 0 358.367 0 0 0 0 0 342.019 0 0 0 0 0 325.567 0 0 0 0 0 309.016 0 0 0 0 292.371 0 0 0 0 275.637 0 0 0 258.818 0 0 0 0 241.921 0 0 0 224.95 0 0 0 207.911 0 0 190.808 0 0 173.647 0 0 156.434 0 0 139.172 0 121.868 0 104.527 0 87.1547 69.7554 52.3349 -0.00111659 ; #X coords 0 0 1000 1000 200 200 1; #X restore 151 115 graph; #X obj 31 -13 for++ 0 90 20; #X floatatom 31 10 0 0 0 0 - - -; #X obj 31 50 * 6.28319; #X obj 31 30 / 360; #X floatatom 31 70 0 0 0 0 - - -; #X obj 31 90 s radians; #X obj 174 -62 r radians; #X obj 213 -31 sin; #X obj 172 -33 cos; #X obj 172 -7 * 1000; #X obj 234 -6 * 1000; #X obj 414 -57 r radians; #X obj 429 -24 sin; #X obj 388 -26 cos; #X obj 388 43 tabwrite array2; #X obj 451 2 * 100; #X obj 389 1 * 100; #N canvas 0 0 450 300 (subpatch) 0; #X array
Re: [PD] Graph a circle arc in an array?
On 10/04/11 15:12, Tyler Leavitt wrote: I've not had any real success using the formulas with [sin] and [cos]... maybe I'm missing something here. The only solution that I've gotten to work is the midpoint circle algorithm with Peter's patch. A circle centered at the origin is implicitly[1] described by: x^2 + y^2 = r^2 Rearranging this gives: y = +/- sqrt(r^2 - x^2) for -r = x = r Hopefully this more useful for your purposes than the parametric form: (x,y) = (cos(t), sin(t)) for -PI = t = PI Should be much simpler to implement than an optimized-for-integers Bresenham-style implementation. Relatedly[2] I like this function too: f(x,t) = sqrt((t^2)+(x^2)*(2*t+1))-t for -1 = x = 1 and 0 = t [1] http://en.wikipedia.org/wiki/Circle#Cartesian_coordinates [2] http://en.wikipedia.org/wiki/Conic_section Claude -- http://claudiusmaximus.goto10.org ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Graph a circle arc in an array?
On Sun, 10 Apr 2011, Tyler Leavitt wrote: I've not had any real success using the formulas with [sin] and [cos]... I don't know why, but I had assumed that you wanted to plot something parametrically, such as a path drawn from x(t) and y(t) functions, instead of a y(x) function. I was reading too fast. For a y(x) function, sqrt(r*r-x*x) is the formula to use. That is related to the fact that sqrt(1-x*x) = sin(acos(x)) = cos(asin(x)) where asin is anti-sin and acos is anti-cos. It's also related to Pythagoras' theorem x*x + y*y = r*r which is also sin(t)*sin(t) + cos(t)*cos(t) = 1. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Graph a circle arc in an array?
Using the sqrt(r^2-x^2) formula I get the same results as with the [sin], [cos]. Maybe I'm just implementing it wrong, but I can't figure out why it's not plotting the correct y values... Here's the patch I sent before with my implementation of the sqrt(r^2 - x^2) On Sun, Apr 10, 2011 at 8:52 AM, Mathieu Bouchard ma...@artengine.cawrote: On Sun, 10 Apr 2011, Tyler Leavitt wrote: I've not had any real success using the formulas with [sin] and [cos]... I don't know why, but I had assumed that you wanted to plot something parametrically, such as a path drawn from x(t) and y(t) functions, instead of a y(x) function. I was reading too fast. For a y(x) function, sqrt(r*r-x*x) is the formula to use. That is related to the fact that sqrt(1-x*x) = sin(acos(x)) = cos(asin(x)) where asin is anti-sin and acos is anti-cos. It's also related to Pythagoras' theorem x*x + y*y = r*r which is also sin(t)*sin(t) + cos(t)*cos(t) = 1. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC #N canvas 638 7 732 664 10; #X obj 171 35 tabwrite array1; #X obj 31 -34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #N canvas 0 0 450 300 (subpatch) 0; #X array array1 1000 float 3; #A 0 1000 -1.11659e-06 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 999.848 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 999.391 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 998.63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 997.564 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 996.195 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 994.522 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 992.546 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 990.268 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 987.688 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 984.808 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 981.627 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 978.148 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 974.37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 970.296 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 965.926 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 961.262 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 956.305 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 951.056 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 945.518 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 939.693 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 933.58 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 927.184 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 920.505 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 913.545 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 906.308 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 898.794 0 0 0 0 0 0 0 0 0 0 0 0 0 0 891.006 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 882.947 0 0 0 0 0 0 0 0 0 0 0 0 0 0 874.62 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 866.025 0 0 0 0 0 0 0 0 0 0 0 0 0 0 857.167 0 0 0 0 0 0 0 0 0 0 0 0 0 848.048 0 0 0 0 0 0 0 0 0 0 0 0 0 0 838.67 0 0 0 0 0 0 0 0 0 0 0 0 0 0 829.037 0 0 0 0 0 0 0 0 0 0 0 0 0 819.152 0 0 0 0 0 0 0 0 0 0 0 0 0 809.017 0 0 0 0 0 0 0 0 0 0 0 0 0 798.635 0 0 0 0 0 0 0 0 0 0 0 0 0 788.01 0 0 0 0 0 0 0 0 0 0 0 0 0 777.146 0 0 0 0 0 0 0 0 0 0 0 0 766.044 0 0 0 0 0 0 0 0 0 0 0 0 0 754.709 0 0 0 0 0 0 0 0 0 0 0 0 743.145 0 0 0 0 0 0 0 0 0 0 0 731.353 0 0 0 0 0 0 0 0 0 0 0 0 719.339 0 0 0 0 0 0 0 0 0 0 0 0 707.106 0 0 0 0 0 0 0 0 0 0 0 694.658 0 0 0 0 0 0 0 0 0 0 0 681.998 0 0 0 0 0 0 0 0 0 0 0 669.13 0 0 0 0 0 0 0 0 0 0 656.059 0 0 0 0 0 0 0 0 0 0 0 642.787 0 0 0 0 0 0 0 0 0 0 629.32 0 0 0 0 0 0 0 0 0 0 615.661 0 0 0 0 0 0 0 0 0 601.815 0 0 0 0 0 0 0 0 0 0 587.785 0 0 0 0 0 0 0 0 0 573.576 0 0 0 0 0 0 0 0 0 559.192 0 0 0 0 0 0 0 0 544.638 0 0 0 0 0 0 0 0 0 529.919 0 0 0 0 0 0 0 0 515.037 0 0 0 0 0 0 0 0 499.999 0 0 0 0 0 0 0 484.809 0 0 0 0 0 0 0 469.471 0 0 0 0 0 0 0 0 453.99 0 0 0 0 0 0 438.37 0 0 0 0 0 0 0 422.618 0 0 0 0 0 0 406.736 0 0 0 0 0 0 390.73 0 0 0 0 0 0 374.606 0 0 0 0 0 358.367 0 0 0 0 0 342.019 0 0 0 0 0 325.567 0 0 0 0 0 309.016 0 0 0 0 292.371 0 0 0 0 275.637 0 0 0 258.818 0 0 0 0 241.921 0 0 0 224.95 0 0 0 207.911 0 0 190.808 0 0 173.647 0 0 156.434 0 0 139.172 0 121.868 0 104.527 0 87.1547 69.7554 52.3349 -0.00111659 ; #X coords 0 0 1000 1000 200 200 1; #X restore 151 115 graph; #X obj 31 -13 for++ 0 90 20; #X floatatom 31 10 0 0 0 0 - - -; #X obj 31 50 * 6.28319; #X obj 31 30 / 360; #X floatatom 31 70 0 0 0 0 - - -; #X obj 31 90 s radians; #X obj 174 -62 r radians; #X obj 213 -31 sin; #X obj 172 -33 cos; #X obj 172 -7 * 1000; #X obj 234 -6 * 1000; #X obj 414 -57 r radians; #X obj 429 -24 sin; #X obj 388 -26 cos; #X obj 388 43 tabwrite array2; #X obj 451 2 * 100; #X obj 389 1 * 100; #N canvas 0 0 450 300 (subpatch) 0; #X array array2 100 float 3; #A 0 100 99.9848 0 99.9391 0 99.863 99.7564 0 99.6195 0 99.4522 0 99.2546 99.0268 0 98.7688 0 98.4808 0 98.1627 97.8148 0 97.437 0 97.0296 96.5926 0 96.1262 0 95.6305 95.1056 0 94.5518 0 93.9693 93.358 0 92.7184 0 92.0505 91.3545 0 90.6308 89.8794 0 89.1006 88.2947 0 87.462 0 86.6025 85.7167 84.8048 0 83.867 82.9037 0 81.9152 80.9017 0 79.8635 78.801 77.7146 0 76.6044 75.4709 74.3145 0 73.1353 71.9339 70.7106 69.4658 0 68.1998 66.913 65.6059 64.2787 62.932 61.5661 60.1814 58.7785 57.3576 55.9192 54.4638 52.9919 51.5037 49. 48.4809 46.9471 43.837 42.2618 40.6736 37.4606 34.2019 32.5567 29.2371 25.8818 20.7911
Re: [PD] Graph a circle arc in an array?
On Sun, 10 Apr 2011, Tyler Leavitt wrote: Using the sqrt(r^2-x^2) formula I get the same results as with the [sin], [cos]. Maybe I'm just implementing it wrong, but I can't figure out why it's not plotting the correct y values... Here's the patch I sent before with my implementation of the sqrt(r^2 - x^2) The x is supposed to be the right-inlet of [tabwrite], not the left-inlet. Otherwise you will write many values in the same location, while skipping many other locations. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Graph a circle arc in an array?
Heh... wow. Thanks for pointing out my negligence and all the help up to this point =) Tyler On Sun, Apr 10, 2011 at 9:59 AM, Mathieu Bouchard ma...@artengine.cawrote: On Sun, 10 Apr 2011, Tyler Leavitt wrote: Using the sqrt(r^2-x^2) formula I get the same results as with the [sin], [cos]. Maybe I'm just implementing it wrong, but I can't figure out why it's not plotting the correct y values... Here's the patch I sent before with my implementation of the sqrt(r^2 - x^2) The x is supposed to be the right-inlet of [tabwrite], not the left-inlet. Otherwise you will write many values in the same location, while skipping many other locations. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Graph a circle arc in an array?
On Fri, 8 Apr 2011, Tyler Leavitt wrote: I am trying to graph a section of a circle into an array. I have been trying to wrap my head around [sin] and [cos] but none of my configurations get results. If you had a circle with radius 100 with a center at (0, 0) I'm trying to get the upper right quadrant (positive x and positive y). The start point being (100,0) and the end point being (0,100). Any ideas on moving forward? use angles between 0 and pi/2 = 1.5708 putting those into [cos] and [sin] will give you values for a circle of radius 1 at (0,0). For different radiuses you apply [*] after that. quadrants and clockwiseness depend on which axis uses [cos], which axis uses [sin], and which direction of each axis is positive. There are several standards for those things. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Graph a circle arc in an array?
By the way, there's a way to draw a circle using nothing but addition: http://en.wikipedia.org/wiki/Midpoint_circle_algorithm Implementing this in Pd is completely impractical, but it's fun to think about. Cheers, Peter On Sat, Apr 9, 2011 at 2:12 AM, Mathieu Bouchard ma...@artengine.ca wrote: On Fri, 8 Apr 2011, Tyler Leavitt wrote: I am trying to graph a section of a circle into an array. I have been trying to wrap my head around [sin] and [cos] but none of my configurations get results. If you had a circle with radius 100 with a center at (0, 0) I'm trying to get the upper right quadrant (positive x and positive y). The start point being (100,0) and the end point being (0,100). Any ideas on moving forward? use angles between 0 and pi/2 = 1.5708 putting those into [cos] and [sin] will give you values for a circle of radius 1 at (0,0). For different radiuses you apply [*] after that. quadrants and clockwiseness depend on which axis uses [cos], which axis uses [sin], and which direction of each axis is positive. There are several standards for those things. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list circle.pd Description: Binary data ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Graph a circle arc in an array?
On Sat, 9 Apr 2011, Peter Brinkmann wrote: By the way, there's a way to draw a circle using nothing but addition: http://en.wikipedia.org/wiki/Midpoint_circle_algorithm Implementing this in Pd is completely impractical, but it's fun to think about. It's not strictly the same thing, because by using sin and cos, you are ensuring equal distance between points at infinite resolution, and you are ensuring equal angles everywhere too. With the midpoint circle algorithm, instead, you are ensuring that all points are one pixel apart, when using a limited resolution. The pixels are considered one pixel apart when sharing an edge or corner. This is related to http://en.wikipedia.org/wiki/Maximum_norm So, it depends on whether you're trying to draw something continuous-looking on a pixel display. ___ | Mathieu Bouchard tél: +1.514.383.3801 Villeray, Montréal, QC ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Graph a circle arc in an array?
On Sat, Apr 9, 2011 at 7:32 PM, Mathieu Bouchard ma...@artengine.ca wrote: On Sat, 9 Apr 2011, Peter Brinkmann wrote: By the way, there's a way to draw a circle using nothing but addition: http://en.wikipedia.org/wiki/Midpoint_circle_algorithm Implementing this in Pd is completely impractical, but it's fun to think about. It's not strictly the same thing, because by using sin and cos, you are ensuring equal distance between points at infinite resolution, and you are ensuring equal angles everywhere too. With the midpoint circle algorithm, instead, you are ensuring that all points are one pixel apart, when using a limited resolution. The pixels are considered one pixel apart when sharing an edge or corner. This is related to http://en.wikipedia.org/wiki/Maximum_norm So, it depends on whether you're trying to draw something continuous-looking on a pixel display. Sure, but in this case the goal was to draw a section of a circle in an array, and the midpoint algorithm would be a good choice if implementing it in Pd weren't so complex. Anyway, it doesn't really matter, I just like Bresenham-style algorithms. Cheers, Peter ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
[PD] Graph a circle arc in an array?
Hello all, I am trying to graph a section of a circle into an array. I have been trying to wrap my head around [sin] and [cos] but none of my configurations get results. If you had a circle with radius 100 with a center at (0, 0) I'm trying to get the upper right quadrant (positive x and positive y). The start point being (100,0) and the end point being (0,100). Any ideas on moving forward? Tyler ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list