From roberthpike at yahoo.com Thu Apr 14 07:50:37 2011 From: roberthpike at yahoo.com (Robert Pike) Date: Thu, 14 Apr 2011 07:50:37 -0700 (PDT) Subject: [kw-pm] Angles Message-ID: <838348.54521.qm@web120518.mail.ne1.yahoo.com> Anyone have the formula (in Perl) to determine any 1 angle of a triangle when given all 3 sides? Appreciate it if you could pass my way as what I've been trying doesn't seem to be working. Thanks. From foxryan at gmail.com Thu Apr 14 07:57:07 2011 From: foxryan at gmail.com (Ryan Fox) Date: Thu, 14 Apr 2011 10:57:07 -0400 Subject: [kw-pm] Angles In-Reply-To: <838348.54521.qm@web120518.mail.ne1.yahoo.com> References: <838348.54521.qm@web120518.mail.ne1.yahoo.com> Message-ID: If you have a triangle with vertices labelled A,B,C and edges opposite the vertices labelled a,b,c, then: C = acos((a**2 + b**2 - c**2)/(2*a*b)) Keep in mind, this result will be in radians, not degrees. Use rad2deg() to get degrees. On Thu, Apr 14, 2011 at 10:50 AM, Robert Pike wrote: > Anyone have the formula (in Perl) to determine any 1 angle of a triangle > when given all 3 sides? Appreciate it if you could pass my way as what I've > been trying doesn't seem to be working. Thanks. > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler at piwebsolutions.ca Thu Apr 14 08:15:56 2011 From: tyler at piwebsolutions.ca (Tyler Slijboom) Date: Thu, 14 Apr 2011 11:15:56 -0400 Subject: [kw-pm] Angles In-Reply-To: <838348.54521.qm@web120518.mail.ne1.yahoo.com> References: <838348.54521.qm@web120518.mail.ne1.yahoo.com> Message-ID: <1302794156.1939.10.camel@inspiron> I think what you want is: use Math::Trig qw( acos ); $angle_a = acos( ($C ** 2 + $B ** 2 - $A ** 2 ) / 2 * $C * $B ) ; http://en.wikipedia.org/wiki/Law_of_cosines Or is that what you already tried? On Thu, 2011-04-14 at 07:50 -0700, Robert Pike wrote: > Anyone have the formula (in Perl) to determine any 1 angle of a triangle when given all 3 sides? Appreciate it if you could pass my way as what I've been trying doesn't seem to be working. Thanks. > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm From roberthpike at yahoo.com Thu Apr 14 08:20:38 2011 From: roberthpike at yahoo.com (Robert Pike) Date: Thu, 14 Apr 2011 08:20:38 -0700 (PDT) Subject: [kw-pm] Angles Message-ID: <900712.97511.qm@web120514.mail.ne1.yahoo.com> Thanks to all that replied. I thought it was something I was leaving out or the code that generated the sides but I was missing the rad2deg call afterwards. Thanks again. From daniel at coder.com Tue Apr 19 08:00:01 2011 From: daniel at coder.com (Daniel R. Allen) Date: Tue, 19 Apr 2011 11:00:01 -0400 (EDT) Subject: [kw-pm] Thursday /pub/social: McCabe's, Kitchener Message-ID: We are having a social meetup this Thursday, 21 April, at or around 7pm. The probability waveform has collapsed and the location is McCabe's Pub, 352 King St W, Kitchener, ON. We'll just try and find each other... If all else fails, send me a text (519-781-7733) From oreilly at post.oreilly.com Tue Apr 26 00:29:21 2011 From: oreilly at post.oreilly.com (O'Reilly Media) Date: Tue, 26 Apr 2011 00:29:21 -0700 Subject: [kw-pm] Deal/Day: Save 50% - Arduino Ebooks & Videos, + Free Shipping on 5 Kits from MakerShed Message-ID: <1303802961.7883.0.911938@post.oreilly.com> View in browser: http://post.oreilly.com/rd/9z1z48h6sog26qdmnc1dae6mkdfnlfl7di7ue1id9m8 ** Save 50% - Deal of the Day ** Arduino Ebooks and Videos For one day only, you can SAVE 50% on all Arduino ebooks and videos. Use discount code DDARD in the shopping cart. This offer may not be combined with other offers. Ebooks and videos from oreilly.com are DRM-free. You get free lifetime access, multiple file formats, free updates. Subscribe to our Deal Feed: http://post.oreilly.com/rd/9z1z4q941a1cist8ivb5819abhla0hq74sa4o7ed9d0 -------------------------------------------------------------- Make: Arduino Bots and Gadgets http://post.oreilly.com/rd/9z1zs0uki7enbhqesqa1mrj0bomep11goin811tbco0 Want to build your own robots, turn your ideas into prototypes, control devices with a computer, or make your own cell phone applications? It's a snap with this book and the Arduino open source electronic prototyping platform. Get started with six fun projects and achieve impressive results quickly. You'll gain the know-how and experience you need to invent your own gadgets. Released: March 2011 Was: $27.99 Now: $13.99 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1zsd74up7vhqn3mi14seed4kud8hc2pm7rpo24br8 -------------------------------------------------------------- ** More Arduino Ebooks and Videos ** Arduino Cookbook http://post.oreilly.com/rd/9z1ztoiu6uqu24n47o6912hirpme1f4a9kqd447v28o Was: $31.99 Now: $15.99 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1zsg8mn8k5lvj6nfdlmc8d3l1tphehdqipp1q09h0 Making Things Talk http://post.oreilly.com/rd/9z1z2qjd4insh3cmdildocq2tr9ho31t1l4uiivsp60 Was: $23.99 Now: $11.99 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1z0oln068o4pk1hfl7e4f51bjtetjpm8gl7vjmdp0 Arduino Up and Running http://post.oreilly.com/rd/9z1zmlrn2p3870akk1070eq04nib7p78388e36qqtcg Was: $29.00 Now: $14.99 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1zl6blnn8i3md1tfot9ddtpbv6nb3mok1ltk2cb58 Processing and Arduino in Tandem http://post.oreilly.com/rd/9z1zaq0r76s9vee2rd028f4vdutp00sr8djp7ridhe0 Was: $89.99 Now: $44.50 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1z3db4fjp3d2igeblm4ievdd5sj8v5d972giuopcg Programming Interactivity http://post.oreilly.com/rd/9z1zqu73r03uqog2gb0eav2cdq4k6j2sbadcq770kvg Was: $39.99 Now: $19.99 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1zckrs49nbg1ch43otutnaehfl90q44las26pa1to Building Wireless Sensor Networks http://post.oreilly.com/rd/9z1zq7ksl8eqor8j7ghidpb0d1sarh8aphm0ua8m7r8 Was: $27.99 Now: $13.99 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1zcbu8ffif5dkp13hlt9jdc73u9krcodeo1dap0o0 Getting Started with Arduino http://post.oreilly.com/rd/9z1zmnas9q3hdna2stnhhp3j50g6cdruvje57uabus8 Was: $9.99 Now: $4.99 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1zsvreoqnmfv7gqhjkpilegnmu3m4ceq6vl9an3g0 Getting Started with Processing http://post.oreilly.com/rd/9z1zep8td9gadpodvcerkqah6bopgh7cvfiu334u3rg Was: $12.99 Now: $6.49 (Save 50%) Add to Cart: http://post.oreilly.com/rd/9z1z8ieo8fd1fuh8o83021mfvmje1v7qu77hjolm470 -------------------------------------------------------------- ** Related Products from Maker SHED ** Free Shipping - Use discount code SHEDUINO Getting Started with Arduino Kit V2.0 Our Price: $75.00 Buy Now: http://post.oreilly.com/rd/9z1ztbouklta44k4b5b2d91m51sdhoujg1j0nrtf4ho MakerShield Kit Our Price: $16.95 Buy Now: http://post.oreilly.com/rd/9z1zp1naujmnaeqpmoma3mfgcjv1ebnk8il1t5oqr8g Voice Shield kit for Arduino Our Price: $45.95 Buy Now: http://post.oreilly.com/rd/9z1zhubeplf90mvpr8tiru8bt0ellh2m757ji8lntno Netduino Our Price: $34.95 Buy Now: http://post.oreilly.com/rd/9z1zrk7ij6c6muljvfeehgr9mivdbeajd5mbj4jil10 Mintduino + Survival Pack Our Price: $39.98 Buy Now: http://post.oreilly.com/rd/9z1zg81ll6grcntsvl3fcqgpk3hic4c0o678knkduh8 Forward this special offer to a friend: http://post.oreilly.com/f2f/9z1zcf23dbeo94hcshm08v1ck49m4dj118kp98q329g -------------------------------------------------------------- O'Reilly - Spreading the knowledge of innovators | oreilly.com -------------------------------------------------------------- You are receiving this message because you purchased directly from O'Reilly or you registered titles at register.oreilly.com. Keep up on all things O'Reilly by signing up for our email alerts and newsletters: http://post.oreilly.com/rd/9z1zl5v2hff4upjnscke7k9m3qbm7esp4v7pe672r4g To ensure delivery to your inbox (not bulk or junk folders), please add oreilly at post.oreilly.com to your address book. To unsubscribe from all email announcements from O'Reilly: http://post.oreilly.com/prefs/9z1zi8l52rck1vrc64bl2e46qh6atl3dptkb0acoloo O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 (707) 827-7000 -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberthpike at yahoo.com Wed Apr 27 13:51:20 2011 From: roberthpike at yahoo.com (Robert Pike) Date: Wed, 27 Apr 2011 13:51:20 -0700 (PDT) Subject: [kw-pm] Angle Label Algorithm Message-ID: <116601.59676.qm@web120517.mail.ne1.yahoo.com> Hey all, ???? I'm looking for a flexible algorithm to determine where to place labels for angles. The program is in Java but it shouldn't take too much to convert from Perl to Java if need be. I have 2 adjacent angles adding up to a minimum of 50 to a maximum of 180 degrees. I have the coordinates (x1,y1 and x2,y2) for 3 lines making up the 2 angles (they share a side). The far right angle will always have it's bottom side "flat" on the x-axis and the angles rotate counter-clockwise. What's the easiest/effective way to determine the best position (that most clearly defines each angle) for each label? ???? The top diagram here : http://www.mathsisfun.com/geometry/adjacent-angles.html?or one of the diagrams on http://www.icoachmath.com/Sitemap/AdjacentAngles.html?are 2 places to look at. I don't need to put arcs there just label the angles appropriately. Again, I have the x,y points for the 3 lines I'm drawing for the angles as seen on these sites. I want to keep the amount of code to a minimum so I'm trying to find something with less weight than what I've already got. Any suggestions would be appreciated. Thanks. ? Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: