Ok well now I have really attached the patch... On Sun, Apr 10, 2011 at 7:12 AM, Tyler Leavitt <thecryofl...@gmail.com>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. > > 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.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 >> > >
#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 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.9999 48.4809 46.9471 43.837 42.2618 40.6736 37.4606 34.2019 32.5567 29.2371 25.8818 20.7911 15.6434 -0.000111659 ; #X coords 0 0 100 100 200 200 1; #X restore 374 117 graph; #X obj 594 -49 r radians; #X obj 635 -19 sin; #X obj 594 -21 cos; #X obj 658 7 * 10; #X obj 596 6 * 10; #X obj 595 34 tabwrite array3; #N canvas 0 0 450 300 (subpatch) 0; #X array array3 10 float 3; #A 0 9.96195 9.81627 9.56305 9.20505 8.7462 8.09017 7.19339 6.01815 4.3837 -1.11659e-05; #X coords 0 0 10 10 200 200 1; #X restore 588 120 graph; #X obj 31 -59 loadbang; #X connect 1 0 3 0; #X connect 3 0 4 0; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 9 0 10 0; #X connect 9 0 11 0; #X connect 10 0 13 0; #X connect 11 0 12 0; #X connect 12 0 0 0; #X connect 13 0 0 1; #X connect 14 0 15 0; #X connect 14 0 16 0; #X connect 15 0 18 0; #X connect 16 0 19 0; #X connect 18 0 17 1; #X connect 19 0 17 0; #X connect 21 0 22 0; #X connect 21 0 23 0; #X connect 22 0 24 0; #X connect 23 0 25 0; #X connect 24 0 26 1; #X connect 25 0 26 0; #X connect 28 0 1 0;
_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list