| 12 Sep 2005 10:25:04 pm by Ductapemaster |
|
|
This is my second program (in TI-Basic), so I need some suggestions here. I'm creating a geometry calculator that includes tons of functions: regular polygon area, apothem calc. radius of a circle by circumference and area, circumference by radius and area, area by radius and circumference, volume and surface area of a cube, rectangular solid, cone sphere, and pyramid, interior angle sum and individual angles, same with exterior angles, pythagorean theorem, law of sines/cosines, geometric mean triangle side solver, and geometric mean calculator. If you have any more suggestions on content please let me know. So far I have a program for all of the angle calculations and the area of regular polygons (the formula came ut of the TI-83+ manual...just using my resources :biggrin: ) I need to know, should I use multiple programs to do all of the functions, of should it be one big program? I have most of the menu's set up, thats the easy part...so far it looks good, but doesnt do very much, so I help and suggestions. I know the language pretty well, but as I said b4 this is my second program. BTW im getting the TI connect USB cable soon, but it has to make its way from Florida to California first... I'll post the programs I have so far when I get a chance, including my first program, a quadratic formula solver/grapher. Thaks in advace and sorry for the huge post...  |
| 12 Sep 2005 10:36:43 pm by DigiTan |
|
|
Hey, Ductapemaster. Welcome to the forum. (Red Green Show fan?)
Well, I only did a little 82 BASIC. I think the BASIC guys here would vote for one big program. It might be a speed & size issue. One of the experts here might give more details... |
| 12 Sep 2005 10:52:47 pm by Ductapemaster |
|
|
| Hey thanks! And yes I am a fan. The name comes from my actual love of duct tape...you can do anything with it, except program in TI-Basic...0x5 |
| 12 Sep 2005 11:02:23 pm by DigiTan |
|
|
Yeah Red Green is the greatest! Except the PBS timeslot flips around faster than a gecko on a hotplate. They need to choose a time and keep it!
Anyway, do you have a TI emulator? |
| 12 Sep 2005 11:04:23 pm by Weregoose |
|
|
Geometry Solutions—This page is an excellent source, and perfect for putting your formulas to the test.
Perhaps you could provide a section on definitions. If that sounds good, here's a basic list to get you started:
- Line
- Line Segment
- Ray
- Angle
- Acute Angle
- Obtuse Angle
- 1° Degree
- Right Angle (90°)
- Straight (180°)
- Complete (360°)
- Scalene Triangle
- Right Triangle
- Isosceles Triangle
- Equilateral Triangle
- Circle
- Ellipse
- Arc
- Semicircle
- Radius
- Diameter
- Square
- Rhombus
- Rectangle
- Parallelogram
- Trapezoid
- Quadrilateral
- Pentagon
- Pentagram
- Hexagon
- Octagon
- Triangular Pyramid
- Square Pyramid
- Rectangular Pyramid
- Triangular Prism
- Rectangular Prism
- Cube
- Cylinder
- Cone
- Sphere
- Ellipsoid
Calling subroutines to do the dirty work would certainly be helpful for the programmer, but the additional programs might be a hassle for those who end up using them. Size is a small factor because the extra bytes used to call the programs could simply be replaced by the corresponding blocks of code. In the case of subroutines, speed is still subjective as it relies entirely on the ability of the programmer.
If you have questions in the future, please don't hesitate to ask them. |
| 13 Sep 2005 12:49:43 am by Jeremiah Walgren |
|
|
I think several smaller programs carry the advantage of only loading the ones that you'll need so that you don't have to carry around this enormous program in your memory. I'd like the options more, personally.
Then again, it does create the hassle of finding which ones you want and stuff. Perhaps a version with both? Smaller programs and one big one? |
| 13 Sep 2005 06:36:41 am by leofox |
|
|
| those formula programs won't be that big, so i'd say in one program. But just remember that goto's and labels are slower if the program is bigger. |
| 13 Sep 2005 06:12:35 pm by Ductapemaster |
|
|
| So far, I have a welcome screen, main menu (2d figures, 3d figures, angles, quit), under 2d fig. I have regular polygon area( not written out...), apothem, perimeter, circles, main, and quit. Circles has cirumference, area and radius and plans to be able to calculatr any one of those from either of the other two (ex: area from either circumference or radius). I don't have menus for 3d yet, but angles has interior and external angles, which will so be combined. I have calculator programs for area of regular N sided polygons, interior and exterior angles, and the quadratic formula solver/grapher (separate program). Ill post the programs next... Oh and how do you limit a number by decimal places? the many numbers after the decimal keep overwriting characters in this and other programs... |
| 13 Sep 2005 06:21:28 pm by Weregoose |
|
|
At the start of the program, you can use [font="courier new"]Fix # to set the calculator to display # decimals.
Another way is to [font="courier new"]round(n,#)—Round n to # decimal places. |
| 13 Sep 2005 06:28:09 pm by Ductapemaster |
|
|
Regular polygon area calc
:Output(4,3,"ONLY REGULAR"
:Output(5,5,"POLYGONS!"
:Pause
:ClrHome
:Disp "NUMBER OF SIDES:"
:Prompt N
:Disp "RADIUS MEASURE:"
:Prompt B
:NB2 sin(pi/N)cos(pi/N)->A
:ClrHome
:Disp "SIDES:"
:Disp "RADIUS:"
:Output(3,7,A
:Output(1,8,N
:Output(2,9,B
:Output(3,1,"AREA:" 'I do this b/c it overwrites extra numbers if they get in the way
:Pause
Any Suggestions???
Well this is only par of the code, maybe Ill do a menu program and then many small ones for the calculations...goto's make the program hard to look through for something...what do you guys think? |
| 13 Sep 2005 06:29:38 pm by Ductapemaster |
|
|
Wow, Supergoose, you write that while I was typing...well thanks, I'll add that and try it. Oh and thanks all of you for your help so far, but remember we have a long journey ahead...0x5
==========
Ok tried the fix code and discovered (well I already knew it and forgot...) that it puts zeros ofter numbers w/o #'s after the decimal place. I would like it so it will do that only if it HAS numbers after the decimal place and if it doesnt, it just shows a whold number. I guess I'm an asthetics freak, huh? |
| 13 Sep 2005 06:37:11 pm by DarkerLine |
|
|
| In that case, you have to use round(. |
| 13 Sep 2005 06:43:54 pm by Ductapemaster |
|
|
| but how would I use it so it only rounds if it has decimal places? Wont it put zeros after numbers without decimals? |
| 13 Sep 2005 06:50:21 pm by DarkerLine |
|
|
round( wouldn't do that. for example, round(6.1, 5 returns 6.1, not 6.1000. Turn off the fixed-point option, though.
Edit: I have no doubt you wouldn't do this, but just in case: don't round midway through calculations, only round at the end when you display the answer. |
| 13 Sep 2005 06:53:39 pm by Ductapemaster |
|
|
| Ha, now I understand...thanks! |
| 13 Sep 2005 06:54:10 pm by Weregoose |
|
|
<top secret>
You can omit trailing quotes and parentheses without consequence.
</top secret>
If you prefer, you could change...
[font="courier new"]:Disp "NUMBER OF SIDES:"
:Prompt N
...to just...
[font="courier new"]:Input "NUMBER OF SIDES?",N
For aesthetics, it would please me more to see this:
[font="courier new"]:Disp "SIDES:
:Output(1,8,N
:Disp "RADIUS:
:Output(2,9,B
:Disp "AREA:
:Output(3,7,A
But I'm more than picky. I suppose this is being handled as I write this anyhow.
| Quote: |
| :NB2 sin(pi/N)cos(pi/N)->A |
You'll have to watch out when posting code here—The caret disappeared! 8)
| Quote: |
| Turn off the fixed-point option, though. |
[font="courier new"]Float accomplishes this.
When in doubt, experiment to your heart's content.  |
| 13 Sep 2005 07:01:24 pm by Ductapemaster |
|
|
hmmm, I tried it and it doesnt seem to work. Under mode, the float option is selected and I have the radius and area rounded:
round(B,2 'Radius
round(A,2 'Area
But the area still has like 6 decimal places...
Help...
Edit: I posted this after supergoose...but ill do what you said. Oh and sorry about the spelling  |
| 13 Sep 2005 07:06:15 pm by Weregoose |
|
|
The [font="courier new"]round( only returns a calculation without updating the variable.
| Quote: |
| don't round midway through calculations, only round at the end when you display the answer. |
Here, Sir Robin suggests that you try something like this: [font="courier new"]Output(3,7,round(A,2 |
| 13 Sep 2005 07:08:42 pm by Ductapemaster |
|
|
ohhhhh, got it...also, I made the changes you suggested. I'm really starting to like the input command...
Edit: It works!!! |
| 13 Sep 2005 07:15:40 pm by Weregoose |
|
|
A word of caution: I know this is fast-paced, but double- (and triple-) posting is disallowed. Under reasonable circumstances, this is not a problem at first. It happens commonly when new members arrive. Just to be safe, glance over the Forum Rules and make sure nothing catches you off guard. These are general rules, so there's nothing like...
*looks around*
No 'splodie nuke avatars on Tuesday. :ninja:
Ahem. -Sir Robin |