TuringLib
Author 
Message 
Catalyst

Posted: Thu May 08, 2003 9:30 pm Post subject: TuringLib 


heres a library i compiled of useful fucntion/procs a while ago so i wouldnt have to hunt for them (note: not all are made by me)
Ive posted in submissions since there is no attachments in source
Description: 

Download 
Filename: 
turinglib.t 
Filesize: 
8.17 KB 
Downloaded: 
354 Time(s) 






Sponsor Sponsor



Catalyst

Posted: Thu May 08, 2003 9:46 pm Post subject: (No subject) 


a nice little demo
code:  View.Set ("graphics:400;400,nobuttonbar,position:300;300")
include "turinglib.t"
const mx := maxx div 2
const my := maxy div 2
var x, y : array 1 .. 3 of int
x (1) := mx100
y (1) := my100
x (2) := mx+100
y (2) := my100
x (3) := mx
y (3) := my+141
const dist1 := Math2D.Distance (x (1), y (1), maxx div 2, maxy div 2)
const dist2 := Math2D.Distance (x (2), y (2), maxx div 2, maxy div 2)
const dist3 := Math2D.Distance (x (3), y (3), maxx div 2, maxy div 2)
for i : 1 .. maxx
for k : 1 .. maxy
drawdot (i, k, Color.putRGB ((Math2D.Distance (i, k, x (2), y (2)) / dist2), (Math2D.Distance (i, k, x (1), y (1)) / dist1), (Math2D.Distance (i, k, x (3), y (3)) / dist3)))
end for
end for 






Delta

Posted: Fri May 09, 2003 8:11 am Post subject: (No subject) 


Hey Catalyst can you post the code on here for it and then once I get it delete it because I can't download it because of the security settings on the school computers here.
THNX if you can(or can't)






Homer_simpson

Posted: Fri May 09, 2003 11:48 am Post subject: (No subject) 


bwahahahahaaaaaar..... nice demo 8)






Crono

Posted: Sat May 10, 2003 1:33 pm Post subject: (No subject) 


i didn't see any code for dividing complex #'s, so here's my code with a demo, it corresponds with the existing module already made by Catalyst, u can add it directly into his library, change the numbers around to test its validity if u wish
Code:
code: 
type complex :
record
r : real
i : real
end record
function DivComplex (comp1, comp2 : complex) : complex
var hold : complex
hold.r := ((comp1.r * comp2.r) + (comp1.i * comp2.i)) / ((comp2.r) ** 2 + (comp2.i) ** 2)
hold.i := ((comp1.i * comp2.r)  (comp1.r * comp2.i)) / ((comp2.r) ** 2 + (comp2.i) ** 2)
result hold
end DivComplex
var m, n : complex
m.r := 3
m.i := 3
n.r := 1
n.i := 1
put DivComplex (m, n).r, " + ", DivComplex (m, n).i, "i"







Catalyst

Posted: Sat May 10, 2003 1:42 pm Post subject: (No subject) 


thx for the function I pulled the complex functions from a fractal prog i made which didnt need a div function ill put them in the file






Thuged_Out_G

Posted: Mon Mar 22, 2004 3:59 pm Post subject: (No subject) 


if you dont mind, would you please explain the Math2d and Math3d functions....i dont really understand them lol. thanks in advance






Catalyst

Posted: Mon Mar 22, 2004 5:14 pm Post subject: (No subject) 


Math2D and Math3D are modules
code: 
module Math2D
%% By Catalyst
export Distance, Slope
function Slope (x1, y1, x2, y2 : real) : real
result (y1  y2) / (x1  x2)
end Slope
function Distance (x1, y1, x2, y2 : real) : real
result ((x1  x2) ** 2 + (y1  y2) ** 2) ** 0.5
end Distance
end Math2D
module Math3D
%% By Catalyst
export Distance
function Distance (x1, y1, z1, x2, y2, z2 : real) : real
result ((x1  x2) ** 2 + (y1  y2) ** 2 + (z1  z2) ** 2) ** 0.5
end Distance
end Math3D 
Math2D.Slope is the slope between to points
Math2D.Distance  2D Distance
Math3D.Distance  3D Distance






Sponsor Sponsor



Delos

Posted: Mon Mar 22, 2004 7:58 pm Post subject: (No subject) 


In the 'MathFunc' module, you've redeclared 'tan' and 'tand'.
I guess this was from a bit back, when they didn't exist...but now in 4.0.5 you'll have to change the syntax a tad.
Otherwise, great job.






the_short1

Posted: Tue Mar 23, 2004 11:21 pm Post subject: (No subject) 


WICKED FRIKCING STUFF!!! i made some functiosn at the end of the year... but i didn;t explore on it... i was too busy... now i will be learning them again and realy get into it.... makes it realy nice to incorparate the slope and distance that i learned last year... we used it to find radius and i just was lkie MEH!... i was kinda distacted by some girl too.......... ..... .... .... ... .... .... ... ... anyways... that and pac man.... COOL STUFF!!! WICKED PROGRAM! it will save me time and now i can ditch rapscalions tracker code and make my own.... ( i want to) ez as PIE! <<HAHAHAH>
+ MEGA BITS!!!!
30 !!!! the most ive ever gave...!!!!






shorthair

Posted: Thu Mar 25, 2004 6:17 am Post subject: (No subject) 


Beautilful , Powerful
" Exactly what i always wanted from Turing "
3 cheers forCatalyst , Way t ogo once again you have brought us a great app , i apreciate hte effort that went into this and good luck with future apps
have some bits that you probably dont want






sport

Posted: Mon Mar 29, 2004 8:13 pm Post subject: Help 


Great program all the help in one.







