Author Topic: Circle Graphs  (Read 24726 times)

0 Members and 2 Guests are viewing this topic.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Circle Graphs
« on: September 02, 2010, 08:27:50 pm »
My Functions, Statistics and Trigonometry (FST) teacher said you couldn't graph a pie chart on your calculator. i took this as a challenge, and as a result:

Code: [Select]
ZStandard
84->Xmin
72->Ymax
ZInteger
Degree
SortA(L1
Delvar ADelvar Bdim(L1->dim(L2
Circle(47,31,25,{i
For(Z,1,dim(L1
360L1(Z)/sum(L1->A
Ans+B->B
Line(47,31,47+25sin(Ans),31+25cos(Ans
round(fPart(A/360),3->L2(Z
End

L1 contains your initial data. it's going to be sorted so you can read the circle graph. your data in L1 is displayed starting at the very top of the circle going around clockwise. L2 contains your percentages, rounded to the thousandths. the sorting isn't really necessary, i just like it.

edit: this reminds me.. it's time for me to remake my graphical triangle solver to incorporate the ambiguous case. i'm sure it could use some optimization.
« Last Edit: September 02, 2010, 08:47:21 pm by nemo »


Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Circle Graphs
« Reply #1 on: September 02, 2010, 08:33:48 pm »
LOL have you shown this to your teacher?

I might borrow this just to mess with mine.

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Circle Graphs
« Reply #2 on: September 02, 2010, 08:35:29 pm »
Nice nemo! :)


Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Circle Graphs
« Reply #3 on: September 02, 2010, 08:38:49 pm »
i haven't shown it to her yet. she thinks she's a calculator guru because she can store to variables and use the Rcl function. she once Rcl'd a variable... i was thinking my head why not just type the variable name? but yeah i plan on showing her it tomorrow
thanks apcalc!


Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Circle Graphs
« Reply #4 on: September 02, 2010, 08:54:25 pm »
That is very cool, and very fast :) Great job :D You have got to tell us your teachers reaction :P

Here is a downloadable version for people who don't want to type it in and a screenshot :)

By the way how long did it take you to make that?
« Last Edit: September 02, 2010, 09:02:03 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Circle Graphs
« Reply #5 on: September 02, 2010, 09:34:23 pm »
thanks meishe! i'll be sure to post here once i tell her about it. speaking about that, i'm not sure if i should just show her the source code or disguise it as AsmPrgm:3E7FD306CD2845. (WARNING: BrandonW's OSKill. do NOT run that program.) pros: i'm a legend for using the OSKill on a teacher. cons: i'm gonna be in huge trouble for invalidating my teacher's OS under the guise of a pie charting program.

meishe, it took me about 10 minutes of coding but about a half hour of pondering in math, lol


Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Circle Graphs
« Reply #6 on: September 02, 2010, 09:39:59 pm »
Haha if you do do that, which would be EPIC, I would go with a way of fixing her calculator right after you did it :P And no problem :) But realistically I would just lock the program and then show her how it works.

Very cool though. Do you mean a half-hour to figure out the math to accomplish it or just whether or not to do it for sure?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Circle Graphs
« Reply #7 on: September 02, 2010, 09:43:01 pm »
it would be such a win.. but i don't think i want to get in that trouble. so i'm just gonna lock and hide the program after showing her.

well i couldn't play with it during math. she likes to talk.. and if you aren't listening she gets very upset soo i have to pay attention. she's boring. so i thought about how i might do it. whether to use polar or cartesian coordinates and what window i should use, mainly.


Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Circle Graphs
« Reply #8 on: September 02, 2010, 09:45:44 pm »
Ah ok, gotcha.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Circle Graphs
« Reply #9 on: September 03, 2010, 01:11:58 am »
i haven't shown it to her yet. she thinks she's a calculator guru because she can store to variables and use the Rcl function. she once Rcl'd a variable... i was thinking my head why not just type the variable name? but yeah i plan on showing her it tomorrow
thanks apcalc!
LOL it would have been funny if her RAM was very low and she recalled a string of character containing a 2 byte token at the wrong location. BOOM! garbage scrolling+RAM Clear! ;D

I kinda hate when someone tries to prove me wrong even if I know I am right. Usually it feels good to show them proof. Big slap in the person face for making you waste time arguing with her.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Circle Graphs
« Reply #10 on: September 03, 2010, 01:18:15 am »
Proving people wrong is the best when they are so convinced that they are right :]

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Circle Graphs
« Reply #11 on: September 03, 2010, 01:33:06 am »
Yeah so true. For some reasons, posting good proof seems to let the anger go out too :P (unless the person still tries to prove you wrong afterward, but at that point, it'S best to ignore her).

Some people on forums or IRC did that in the past, although they stopped long ago. One case I remember was when many were telling me the LCD was 95x63 pixels x.x.

Back on topic I like how fast it draws the charts. :)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Circle Graphs
« Reply #12 on: September 03, 2010, 01:36:03 am »
Now its time for the EXPLODED pie charts :O

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Circle Graphs
« Reply #13 on: September 03, 2010, 01:37:33 am »
That makes me think of a cool idea to mess with the teacher :P Make it so there is a little fuse that appears after the graph is displayed and then when it goes down all the way a exploding animation happens :P
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Circle Graphs
« Reply #14 on: September 03, 2010, 01:39:38 am »
Now its time for the EXPLODED pie charts :O
I think that one might be a bit hard x.x