calculus grade 12 homework doer
Author |
Message |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun Sep 07, 2003 8:00 pm Post subject: calculus grade 12 homework doer |
|
|
well i got grade 12 calculus this year so i created this little quick grapher to do my work... i thought u might like to use it also... so feel free to cheat your way out of homework
code: | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%You can change these to change yer graph scaling
const xscale := 20
const yscale := 20
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var x1, y1 := -500
var x, y : real := -20
colorback (16)
cls
drawline (0, 200, 640, 200, 12)
drawline (320, 0, 320, 400, 12)
for i : 0 .. 640 by xscale
drawline (i, 199, i, 201, 8)
end for
for i : 0 .. 400 by yscale
drawline (319, i, 321, i, 8)
end for
procedure drawsdot (x, y, c : real)
drawdot (round (x * xscale) + 320, round (y * yscale) + 200, round (c))
end drawsdot
color (white)
loop
exit when x > 20
x += .001
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%This is where u put your formula%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%y := x ** 2
%y := 2 * (x ** 2) + (4 * x) + 3 % y=2x^2+4x+3
y := .05 * (x ** 3)
%y := 2 * x
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
drawsdot (x, y, 15)
end loop
x := 320
y := 200
color (15)
loop
if hasch then
drawdot (round (x) - 1, round (y), 16)
drawdot (round (x) + 1, round (y), 16)
drawdot (round (x), round (y) + 1, 16)
drawdot (round (x), round (y) - 1, 16)
case getchar of
label "a" :
x -= xscale
label "d" :
x += xscale
label "s" :
y -= yscale
label "w" :
y += yscale
label :
end case
drawdot (round (x) - 1, round (y), 8)
drawdot (round (x) + 1, round (y), 8)
drawdot (round (x), round (y) + 1, 8)
drawdot (round (x), round (y) - 1, 8)
locate (1, 1)
put (x - 320) / xscale, "/", (y - 200) / yscale
end if
end loop
|
[mod:11f4ddc542="Dan"]
Gave you some bits for a nice progame that is a good exaple about grafing stuff in progaming languaes.
[/mod:11f4ddc542] |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Sun Sep 07, 2003 9:34 pm Post subject: (No subject) |
|
|
nice, looks good too. probly whould be ushlfull for thous with out grafing caluators. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
Kingnoz
|
Posted: Mon Sep 08, 2003 5:46 pm Post subject: (No subject) |
|
|
good work on the program, i will have to save that until next year ![Very Happy Very Happy](http://compsci.ca/v3/images/smiles/icon_biggrin.gif) |
|
|
|
|
![](images/spacer.gif) |
PaddyLong
|
Posted: Mon Sep 08, 2003 6:41 pm Post subject: (No subject) |
|
|
man grade 12 calculus sucked soo bad... probably because the teacher spent pretty much the entire class answering stupid people's questions although I some how managed to get an 80 in it even though I didn't do half the questions on the last few tests (if the question seemed like it was going to be a lot of work I just didn't do it)
here's a program I wrote in grade 9 or 10 to do work for me ... it just outputs the three forms of quadratics based on the "a" value and the vertex coords
code: |
procedure input (var x, y, a : real)
put "what is the x value of the vertex?"
get x
put "what is the y value of the vertex?"
get y
put "what is the value for a?"
get a
end input
procedure output (h, k, a : real)
var b : real := - 2 * a * h
var c : real := a * h ** 2 + k
var b24ac : real := b ** 2 + ( - 4 * a * c)
var zero1, zero2 : real
put "general form: " ..
if 2 * a * h > 0 then
if a * h ** 2 + k > 0 then
put a, "x", chr (253), " - ", b * - 1, "x + ", c
elsif a * h ** 2 < 0 then
put a, "x", chr (253), " - ", b * - 1, "x - ", c * - 1
end if
elsif 2 * a * h <= 0 then
if a * h ** 2 + k >= 0 then
put a, "x", chr (253), " + ", b, "x + ", c
elsif a * h ** 2 < 0 then
put a, "x", chr (253), " + ", b, "x - ", c * - 1
end if
end if
put "vertex form: " ..
if h >= 0 then
if k >= 0 then
put a, "(x - ", h, ")", chr (253), " + ", k
elsif k < 0 then
put a, "(x - ", h, ")", chr (253), " - ", k * - 1
end if
elsif h < 0 then
if k >= 0 then
put a, "(x + ", h * - 1, ")", chr (253), " + ", k
elsif k < 0 then
put a, "(x + ", h * - 1, ")", chr (253), " - ", k * - 1
end if
end if
put "factored form: " ..
if b24ac * - 1 >= 0 then
zero1 := (b * - 1 + sqrt (b24ac * - 1)) / 2 * a
zero2 := (b * - 1 - sqrt (b24ac * - 1)) / 2 * a
elsif b24ac >= 0 then
zero1 := (b * - 1 + sqrt (b24ac)) / 2 * a
zero2 := (b * - 1 - sqrt (b24ac)) / 2 * a
else
put "no real zeros"
end if
if zero1 >= 0 then
if zero2 >= 0 then
put "(x + ", zero1, ")(x + ", zero2, ")"
elsif zero2 < 0 then
put "(x + ", zero1, ")(x - ", zero2 * - 1, ")"
end if
elsif zero1 < 0 then
if zero2 >= 0 then
put "(x - ", zero1 * - 1, ")(x + ", zero2, ")"
elsif zero2 < 0 then
put "(x - ", zero1 * - 1, ")(x - ", zero2 * - 1, ")"
end if
end if
end output
var x, y, a : real
input (x, y, a)
output (x, y, a)
|
|
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Mon Sep 08, 2003 8:22 pm Post subject: (No subject) |
|
|
whooohoo bits =Þ
and yeah calculus has been easy so far i guess because we haven't gotten so far yet :S right now we at polynomial divisions |
|
|
|
|
![](images/spacer.gif) |
rizzix
|
Posted: Tue Sep 09, 2003 2:57 pm Post subject: (No subject) |
|
|
same here. |
|
|
|
|
![](images/spacer.gif) |
Papageorgeo
|
Posted: Tue Sep 09, 2003 3:08 pm Post subject: (No subject) |
|
|
Calculus only gets harder from where you are. I took it last year and it wasn't my best mark... |
|
|
|
|
![](images/spacer.gif) |
PaddyLong
|
Posted: Tue Sep 09, 2003 5:08 pm Post subject: (No subject) |
|
|
algeo > calculus
bleh.... o well, my math course in first year college seems like it's pretty much a big review of grade 12 algeo and calculus so it should be pretty easy 8) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
templest
![](http://img.photobucket.com/albums/v251/templest/a8affa62.jpg)
|
Posted: Wed Oct 01, 2003 8:35 pm Post subject: (No subject) |
|
|
hahaha... Seems like all of us have made a program to do our homework at one point or another. I just made one a couple days ago to find the value of "x" using the quadratic formula by inputing the "a", "b", and "c" value. Made it do it backwards to to find the formula from the two co-ordinates. I have a feeling your program will come in handy. ![Twisted Evil Twisted Evil](images/smiles/icon_twisted.gif) |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
|
|
|
![](images/spacer.gif) |
|
|