Saturday, June 12, 2021

7000G Retro Month - June 12 Edition

7000G Retro Month - June 12 Edition



Introduction


Welcome to the 7000G Retro Month, which features programming for the classic Casio calculators from the mid/late 1980s:  primarily fx-7000G and fx-7500G.  Since the programming language stays similar throughout the years, programs can be translated to the fx-6300G and later graphing calculators with little to no adjustments.  Non graphic programs should be ported to the fx-4000P, fx-4500P (A), fx-3650p (II), fx-50F Plus (II), and fx-5800P with little to no adjustments.  


7000G Retro Month takes place every Saturday during June 2021.


To make text easier to type, I can going to use the following text friendly symbols for the following:


->  for →


/I for ⊿


=> for ⇒


What do you think?   Unicode or simple text equivalents?  


- - - - - - -- - -- - -


Today's subject revolves around Graphics.  Enjoy!


- - - -- - - -- - -- -- -


Get a emulator or graphing calculator to see the results.


Quadratic Fit by Two Roots


Given two roots A and B, the program generates a quadratic equation and it's graph.   The program assumes that the vertex is a minimum.


Y = (X - A) (X - B)


"ROOT1" -> A

"ROOT2" -> B

"Y = X^2 - " /I

A+B /I

"X + " /I

AB /I

Cls

Graph Y=(X-A)(X-B)


Polar Plotting (Self Contained)


I usually use Radians (Mode 5 for fx-7000G, fx-7500G, fx-6300G) angle mode when it comes to graphics and calculus.  To set/change each equation, you will need to edit the program here.  I state the equation to be in the form r(T) where T = θ.  


On the Rec command, x is stored to I and y is stored to J.  (specific to fx-7000G, fx-7500G, fx-6300G)


"POLAR R(T)"

Rad

"RMIN"? -> A

"RMAX"? -> B

"N"? -> N

(B-A)÷N -> H

A-H -> T

Cls

Lbl 1

T+H -> T

[insert r(T) here]

Rec(Ans, T)

Plot I,J

T<B => Goto 1


Cubic Bezier Curve


This program plots a cubic Bezier curve with the following variables:


(x0, y0):  A = A[0], B = A[1]  (exact fit)

(x1, y1):  C = A[2], D = A[3]

(x2, y2):  E = A[4], F = A[5]

(x3, y3):  G = A[6], H = A[7]   (exact fit)


Cls

0 -> I

"CUBIC BEZIER"

Lbl 1

"X"? -> A[ I ]

Isz I

"Y"? -> A[ I ]

Isz I

I < 8 => Goto 1

0 -> T

Lbl 2

A(1-T)^3 + 3C(1-T)^2 T + 3E(1-T) T^2 + GT^3 -> X

B(1-T)^3 + 3D(1-T)^2 T + 3F(1-T) T^2 + HT^3 -> Y

Plot X,Y

T+.02 -> T

T<1 => Goto 2


Press [ G<>T ] to see the graph.  


Polygon Drawing


The programs allow the user to draw many lines in a row by connecting points.   The original point are stored in variables E and F.   To complete the polygon, use (E, F) as the final point.  


The prompt MORE:  enter 0 to stop, anything else to continue connecting points


Cls

"X0"? -> A : A -> E

"Y0"? -> B : B -> F

Plot A,B

Lbl 1

"ORIG (E,F)"

"NEXT X"? -> C

"NEXT Y"? -> D

0 -> T

Lbl 2

(1-T)A+CT -> X

(1-T)B+DT -> Y

Plot X,Y

T+.02->T

T<1 => Goto 2

C -> A : D -> B

"MORE"? -> M

M≠0 => Goto 1


Drawing an Ellipse


This program draws an ellipse.  


"ELLIPSE"

"X RADIUS"? -> A

"Y RADIUS"? -> B

Rad

Cls

Range -A-.5,A+.5,(2A+1)÷20,-B-.5,B+.5,(2B+1)÷20

0 -> T

Lbl 1

Plot A cos T, B sin T

T+2π÷64 -> T

T<2π => Goto 1


Press [ G<>T ] to see the graph.  


Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.