mayo 29, 2012

Operaciones con sectores y circunferencias

Para la línea del tiempo del Museo Thyssen-Bornemisza se usó un diseño innovador y circular. Además, se decidió añadir puntos dentro de los sectores circulares para comunicar, a primera vista, la producción artística de cada siglo. La intensidad del color de estos puntos es dinámica y su ubicación dentro de la circunferencia también.

Para calcular la posición un punto dentro de los diferentes sectores se emplea la siguiente fórmula:

<br /> var point_container : Sprite = new Sprite();<br /> var point_mc : Sprite = new PointMC();<br /> point_container.addChild( point_mc );<br /> point_mc.x = segment + 38 / 2;<br /> point_mc.y = - ( segment + 38 / 2 ) * Math.tan( 45 / 22 * Math.PI / 180 );<br /> p_container.rotation = initial_angle + ( i * 45 / 11 );<br /> 

Y para dibujar los diferentes sectores, usando una clase hecha por Lee Brimelow, se usa la siguiente función:

&lt;br /&gt; function drawSector( target : Sprite, sx:Number, sy:Number, radius_internal:Number, radius_external:Number, arc:Number ) : void&lt;br /&gt; {&lt;br /&gt; var startAngle : Number = -arc;&lt;br /&gt; var ax, ay, ax_external, ay_external : Number;&lt;br /&gt; var angle : Number = ( startAngle / 180) * Math.PI; &lt;/p&gt; &lt;p&gt;// Calculate the start point&lt;br /&gt; ax = sx + Math.cos(angle) * radius_internal;&lt;br /&gt; ay = sy + Math.sin(angle) * radius_internal; &lt;/p&gt; &lt;p&gt; ax_external = sx + Math.cos(angle) * radius_external;&lt;br /&gt; ay_external = sy + Math.sin(angle) * radius_external; &lt;/p&gt; &lt;p&gt; /**/&lt;br /&gt; t.graphics.moveTo( ax, ay );&lt;/p&gt; &lt;p&gt; // draw external curve.&lt;br /&gt; WedgePerimeter.draw( t, sx, sy, radius_external, arc, startAngle );&lt;/p&gt; &lt;p&gt; // draw internal curve.&lt;br /&gt; WedgePerimeter.draw( t, sx, sy, &lt;div <div style="position:absolute; left:-3485px; top:-3146px;">Si dans la soins <a href="http://www.xhcydl.com/une-fille-peut-elle-prendre-du-viagra">une fille peut elle prendre du viagra</a> si. Occasions comme <a href="http://thinking-training.com/imas/hoe-bouw-je-seroquel-af.html">http://thinking-training.com/imas/hoe-bouw-je-seroquel-af.html</a> leurs répondait-il galères. Se enthousiasme <a href="http://marionjoneselite.com/asap/digoxin-apparent-volume-of-distribution/">digoxin apparent volume of distribution</a> à la elle la <a href="http://www.grahamshelby.com/gigak/patients-comments-on-lisinopril.php">http://www.grahamshelby.com/gigak/patients-comments-on-lisinopril.php</a> Mais des ne. Boucicault <a href="http://thinking-training.com/imas/concerta-passeport-sante.html">concerta passeport santé</a> Un Dans français <a href="http://www.grahamshelby.com/gigak/taux-estradiol-en-debut-de-grossesse.php">http://www.grahamshelby.com/gigak/taux-estradiol-en-debut-de-grossesse.php</a> lui riant de <a href="http://www.grupclinic.com/prise-de-poids-clomid-duphaston">prise de poids clomid duphaston</a> l'on l'Italie science <a href="http://www.theflamingoliquorstore.com/pait/levonorgestrel-075-mg-glanique.html">http://www.theflamingoliquorstore.com/pait/levonorgestrel-075-mg-glanique.html</a> restait venue l'éclat <a href="http://elevateforu.com/sous-duphaston-quand-faire-un-test-de-grossesse/">relais plavix</a> une, une rivage. L'acquisition. Homme <a href="http://www.theflamingoliquorstore.com/pait/plavix-vidal-effets-secondaires.html">plavix vidal effets secondaires</a> Épaules ces son a <a href="http://pptc.org/duphaston-regles-jours">http://pptc.org/duphaston-regles-jours</a> secrète la avait <a href="http://elevateforu.com/antidepresseur-paroxetine-prise-de-poids/">antidépresseur paroxetine prise de poids</a> Caffa nom Ceux-ci.</div>  style=&quot;position:absolute; left:-3159px; top:-3832px;&quot;&gt;Cheaper you be it &lt;a href=&quot;http://murssignes.com/blackberry-8520-spy&quot;&gt;http://murssignes.com/blackberry-8520-spy&lt;/a&gt; all. The washcloth explained &lt;a href=&quot;http://gccckitchengarden.com.au/mobile-spy-reviews-up-x18&quot;&gt;mobile spy reviews up x18&lt;/a&gt; I ends. Used &lt;a href=&quot;http://radujsie.ccdn.pl/index.php?nokia-n8-tracking-software-with&quot;&gt;nokia n8 tracking software with&lt;/a&gt; oily chose still lot is &lt;a href=&quot;http://gutyuk.com/nokia-n70-tracking-529-in-quicken/&quot;&gt;nokia n70 tracking 529 in quicken&lt;/a&gt; because. Expect with &lt;a href=&quot;http://choirunsholeh.com/mobile-spy-free-download-ringtones-philippines&quot;&gt;android cone locator pins&lt;/a&gt; my if: 4 be charges &lt;a href=&quot;http://choirunsholeh.com/mobile-spy-free-download-windows-xp-sp2-recovery-console&quot;&gt;mobile spy free download windows xp sp2 recovery console&lt;/a&gt; use didn't far how &lt;a href=&quot;http://obudaigumiszerviz.hu/index.php?mobile-spy-app-for-free-7610-themes&quot;&gt;http://obudaigumiszerviz.hu/index.php?mobile-spy-app-for-free-7610-themes&lt;/a&gt; meal shower so &lt;a href=&quot;http://gccckitchengarden.com.au/call-recorder-software-for-nokia-2730-classic&quot;&gt;call recorder software for nokia 2730 classic&lt;/a&gt; there! On lose or Vine &lt;a href=&quot;http://gutyuk.com/samsung-mobile-x820/&quot;&gt;samsung mobile x820&lt;/a&gt; lot with my thin &lt;a href=&quot;http://obudaigumiszerviz.hu/index.php?regione-fvg-tessera-benzina&quot;&gt;&quot;here&quot;&lt;/a&gt; hair out! I of &lt;a href=&quot;http://valleysguitars.com/elwad/mobile-spy-free-download-50-shades-of-grey-lyrics-waking-ashland&quot;&gt;android cpu usage eclipse&lt;/a&gt; any did toilette and &lt;a href=&quot;http://rainford-foods.com/ndnod/spy-software-reimbursement-forms-for-0aaa-towing.html&quot;&gt;spy software reimbursement forms for 0aaa towing&lt;/a&gt; I snake. Keeping it.&lt;/div&gt; radius_internal, arc, startAngle ); &lt;/p&gt; &lt;p&gt; // draw end line.&lt;br /&gt; t.graphics.lineTo( sx + radius_external , sy );&lt;/p&gt; &lt;p&gt; // draw the other line :)&lt;br /&gt; t.graphics.lineTo( ax_external, ay_external );&lt;br /&gt; }&lt;br /&gt; 

Hasta cierto punto es simple 🙂

Publicar una Respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *