Jump to content



Photo
- - - - -

Programming


  • Please log in to reply
22 replies to this topic

#1 maurice1979

maurice1979

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:The netherlands - Dutch people

  • Calculators:
    CP300, Fx8.... fraction sumtin', old thing with dust, it still works, with the original battery

Posted 26 November 2003 - 01:26 PM

If anyone got url's for tutorials, tips, questions, ect.
I thougth it would be nice to put them here instead in the 'cp300 questions' that should handle more technical about the cp300

#2 maurice1979

maurice1979

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:The netherlands - Dutch people

  • Calculators:
    CP300, Fx8.... fraction sumtin', old thing with dust, it still works, with the original battery

Posted 26 November 2003 - 01:37 PM

So I've got one.
I want to create a function but it's kinda complex to create just with 'define'
what I want to do is define a vector {a,b,c,d,....,n} it goes on -> calculate it's length en the sum of the lengths
the angle between the vectors.

using define I input this for length: define vlength(a,b,c,d,e,f) = sqrt(a^2+b^2+c^2+d^2+e^2+f^2)
UserC300, thank you for that tip.
but then I would have to type in vlength(1,2,0,0,0,0) , I just want to put any amount of numbers.
I think that would require more skill in programing.

#3 Andy.Davies

Andy.Davies

    Forum Ghost

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Location:Dorset, England
  • Interests:Age: 18<br />Studying: MEng in cybernetics at Reading uni<br />Interests: Progaming (VB, VB.Net, C#, Casio Basic)<br />Computers UBBD (Using, Building, Breaking &amp; Destroying)<br />Gaming (FPS, RTS, RPG)<br />Electronics<br />Rock Music (Preferably Loud)<br />Riley's (Pool &amp; Snooker Bar)<br />Driving (Preferably fast)<br />Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 26 November 2003 - 01:52 PM

couldnt you put it ina FOR loop? to repeatedly do the squareroot until it has done it for each variable/number

#4 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 26 November 2003 - 03:53 PM

didn't you read my post...

use a list as the argument to your function, that way you can have any size vector..

what I wrote:

alternatively you can define a function that takes any vector (as a list variable):

define len(v)=sum(v^2)^.5

for using it:

len({1,1,1})
(would give sqrt(3))



#5 UserC300

UserC300

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:Germany

  • Calculators:
    Classpad 300, Casio fx-7700G, TI-81

Posted 26 November 2003 - 07:21 PM

BiTwhise is right, we already had that in the "CP300 Question-Topic".
By the way, why do you need to know the length of a more than 3-dim-Vector?

If someone is interested, I made an eActivity about "Vektoren":

eActivity Vektoren

#6 Overlord

Overlord

    Casio Technician

  • Moderator
  • PipPipPipPipPipPip
  • 355 posts
  • Gender:Male
  • Location:Brussels - Belgium
  • Interests:Math Researcher

  • Calculators:
    My head - C300 OS 3.00 - G100 Rom 1.02 - G65 - G60 - G25

Posted 26 November 2003 - 09:53 PM

don't you never use more-than-3-dim vectors ?

#7 UserC300

UserC300

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:Germany

  • Calculators:
    Classpad 300, Casio fx-7700G, TI-81

Posted 27 November 2003 - 12:10 AM

I did, but I can`t recall using or looking for the length of a 6-dim-or- something-vector as a number like |[2,4,7,1,3,4]|=9.75. That`s why I`m asking.

btw: at first, when I was just looking at your avatar(kinda scary) and not really reading your post, I misinterpreted it to:
Don`t you ever use 3-dim vectors! :lol:(no offence)

#8 maurice1979

maurice1979

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:The netherlands - Dutch people

  • Calculators:
    CP300, Fx8.... fraction sumtin', old thing with dust, it still works, with the original battery

Posted 28 November 2003 - 09:17 AM

didn't you read my post...

define len(v)=sum(v^2)^.5

I did try define len(v)=sum(v^2)^.5
but instead of v I used x wich somehow didn't work, but I just tried out your method with a v and it worked like a charm :D

I need it for 5 or more dim vectors.
thnx a million

#9 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 28 November 2003 - 10:09 AM

No problem :)

#10 maurice1979

maurice1979

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:The netherlands - Dutch people

  • Calculators:
    CP300, Fx8.... fraction sumtin', old thing with dust, it still works, with the original battery

Posted 05 December 2003 - 07:30 AM

I think I'm getting the hang of it, I was able to create a funtion to calculate the angle between 2 vectors,
but I want to learn more about programming, does anyone know some links??

#11 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 05 December 2003 - 09:12 AM

ask questions, I'll be happy to do a tutoring session with you :lol:

btw: what programming experiance do you have? (if any)

#12 maurice1979

maurice1979

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:The netherlands - Dutch people

  • Calculators:
    CP300, Fx8.... fraction sumtin', old thing with dust, it still works, with the original battery

Posted 05 December 2003 - 09:27 AM

I am familiar with Macomedia's Director
Not that much, but still more than just a little

But with calculators none
your dealing with a dummie :lol:

#13 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 05 December 2003 - 06:00 PM

ok, lets go over a few core commands of basic:

{data} => {var}
the assignment opperator, takes the data and stores it in a variable, the data can be a string, number, list, or matrix (i think thats all).

1=>A //A now equals 1
"Hi"=>Str //Str contains the string "Hi"
{1,2,3}=>Array //Array now contains a 3 dimentionall list
[[0,0][0,0]]=>Mat //Mat contains a 2x2 matrix filled with 0's
= > < >= <=
these check to see if a condition is true or false, if its false the statement will evaluate to 0 if true it will be 1

lets do a quick program:

Lbl prgm //a Lbl is a marker that can be jumped to durring the program by using Goto {lbl name}
InputStr MyName,"Type in your name.","Your Name" // creates an input box that exepts a string, it ask the user for their name and stores it in MyName.
StrJoin "Hello ",name,txt //joins "Hello " and name and stores the result in txt
Print txt //outputs the text

try playing with that a bit, then I'll give you your next lesson :)

#14 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 07 December 2003 - 03:04 AM

Sorry for going back to this after such a long time..

Anyways, a note on the vector length function

If you use the built in vector functions, you probably have your vectors stored in "matrix" format, with '[' and ']' brackets, rather than the list format

To retreive the length of a vector in that format, you can take use of the built in dot product function. Hence the new len(v) function would be defined like this:

define len(v)=dotP(v,v)^.5

#15 maurice1979

maurice1979

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:The netherlands - Dutch people

  • Calculators:
    CP300, Fx8.... fraction sumtin', old thing with dust, it still works, with the original battery

Posted 07 December 2003 - 03:10 PM

no I'm using the list format, but I saw that there is a resemblance between matrix- en list format in these calculations.
I created a function wich already excisted namely Crossp()
wich works better 'cause I weren't able to do this in list format.
with Crossp you can use 2 matrix vectors with list it's (1,2,3,4,5,6) instead of {1,2,3},{4,5,6}
It takes a lot of time to learn how to use your CP.

#16 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 07 December 2003 - 03:28 PM

I would recommend you take use of the built in functions to their fullest, that's eaiser.
If you work alot with vectors, you should switch over to the matrix format and get used to it asap. It makes it much easier to perform, for example, transformations, building arrays of vectors, etc.

#17 Overlord

Overlord

    Casio Technician

  • Moderator
  • PipPipPipPipPipPip
  • 355 posts
  • Gender:Male
  • Location:Brussels - Belgium
  • Interests:Math Researcher

  • Calculators:
    My head - C300 OS 3.00 - G100 Rom 1.02 - G65 - G60 - G25

Posted 07 December 2003 - 07:30 PM

why don't use the norm function ? norm([5,9,1]) = norm of the vector (5,9,1)

#18 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 07 December 2003 - 07:33 PM

Because we are all retarded fools :lol:

Perhaps I should have a seccond look at that .. what was it called.. aye, manual :rolleyes:

#19 Overlord

Overlord

    Casio Technician

  • Moderator
  • PipPipPipPipPipPip
  • 355 posts
  • Gender:Male
  • Location:Brussels - Belgium
  • Interests:Math Researcher

  • Calculators:
    My head - C300 OS 3.00 - G100 Rom 1.02 - G65 - G60 - G25

Posted 07 December 2003 - 08:58 PM

you know today i opened and reread some sections of the manual... and i found commands like cross product, scalar product, conversion tu gauss-jordan matrix, ...

all what would have been useful for the past trimester to save time... :banghead: :banghead: :banghead:

*feels like an idiot*

#20 maurice1979

maurice1979

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:The netherlands - Dutch people

  • Calculators:
    CP300, Fx8.... fraction sumtin', old thing with dust, it still works, with the original battery

Posted 08 December 2003 - 12:44 PM

why don't use the norm function ? norm([5,9,1]) = norm of the vector (5,9,1)

Crossp = the norm of 2 vectors crossing

#21 Overlord

Overlord

    Casio Technician

  • Moderator
  • PipPipPipPipPipPip
  • 355 posts
  • Gender:Male
  • Location:Brussels - Belgium
  • Interests:Math Researcher

  • Calculators:
    My head - C300 OS 3.00 - G100 Rom 1.02 - G65 - G60 - G25

Posted 08 December 2003 - 07:04 PM

the norm of 2 vectors crossing >> don't understand

#22 maurice1979

maurice1979

    Casio Fan

  • Members
  • PipPip
  • 40 posts
  • Location:The netherlands - Dutch people

  • Calculators:
    CP300, Fx8.... fraction sumtin', old thing with dust, it still works, with the original battery

Posted 15 December 2003 - 01:10 PM

I mean the normal

#23 Overlord

Overlord

    Casio Technician

  • Moderator
  • PipPipPipPipPipPip
  • 355 posts
  • Gender:Male
  • Location:Brussels - Belgium
  • Interests:Math Researcher

  • Calculators:
    My head - C300 OS 3.00 - G100 Rom 1.02 - G65 - G60 - G25

Posted 15 December 2003 - 08:57 PM

yes but you must also know the direction of the vector and its length




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users