Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 3rik

Pages: 1 2 [3] 4 5 ... 8
31
Math and Science / Re: Matrices/Complex Numbers
« on: June 14, 2012, 10:46:57 pm »
I found that algorithm. http://en.wikipedia.org/wiki/Strassen_algorithm

I think the extra calculations may actually slow it down in Lua because of all the adding that goes on. I can see how things like servers could benefit from the optimization, especially if they're in a low level language, but I'll probably just stick with the common algorithm.

I had never heard about that algorithm before, though. Thanks :)

32
Math and Science / Matrices/Complex Numbers
« on: June 14, 2012, 02:22:52 pm »
I'm beginning to plan for a library that adds complex numbers and matrices to Lua (both calculator and computer). (There would also be copies that add one or the other because this will probably be a big library that could take a while to load.) I feel like I'm always making simplified versions of these, so I want to just make a complete library and be done with it.

I haven't taken linear algebra yet, but I don't want to have to edit my library later to add new functions, so I need to gather all the operations/features of matrices and complex numbers that would be useful in a multipurpose library. I don't plan on doing much symbolic stuff.

I haven't started coding yet, so suggestions are welcome, but I'll probably add a topic in the Lua section when I get to that point. I'd appreciate help adding to the following list if there's something you think would be useful. I'll get the basic ones out of the way here. If you notice anything that's inaccurate or incomplete, please correct it. :)

Spoiler For One Matrix and One Scalar Operations:
One Matrix and One Scalar Operations:

Spoiler For Addition:
Addition:

Adds the scalar to each element in the matrix

Limitations: none

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D%2B5
Spoiler For Subtraction:
Subtraction:

Add the quantity on the left with the quantity on the right multiplied by -1. (see above and below)

Limitations: none

Example: http://www.wolframalpha.com/input/?i=simplify+5-%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D
Spoiler For Multiplication:
Multiplication:

Multiply each element on the matrix by the scalar.

Limitations: none

Example: http://www.wolframalpha.com/input/?i=simplify+5*%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D
Spoiler For Division:
Division:

If the scalar is on the left, take the multiplicative inverse of each element in the matrix and multiply
If the matrix is on the left, divide each element in the matrix by the scalar

Limitations: If the matrix is on the right, it may not contain a 0. If the scalar is on the right, it may not be zero.

Example: http://www.wolframalpha.com/input/?i=simplify+5%2F%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D
Spoiler For Exponentiation:
Exponentiation:

If the scalar is the exponent, repeat matrix multiplication the number of times specified.
If the matrix is the exponent, raise the scalar to the power of each element.

Limitations: If the scalar is the exponent, it must be a nonnegative integer (raising it to the 0th power produces an identity matrix) and the matrix must be a square matrix. If the matrix is the exponent, the base must be nonnegative, and if the base is 0, the matrix may not contain nonpositive numbers.

Examples: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D%5E5
http://www.wolframalpha.com/input/?i=simplify+5%5E%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D
Spoiler For Two Matrix, Element-by-Element Operations:
Two Matrix, Element-by-Element Operations:

Spoiler For Equality:
Equality:

If each corresponding element in each matrix are equal, the matrices are equivalent.

Limitations: Matrices must be the same dimensions

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D%3D%3D%7B%7B2%2C+4%2C+6%7D%2C+%7B2%2C+4%2C+6%7D%2C+%7B2%2C+4%2C+6%7D%7D%2F2
Spoiler For Addition:
Addition:

Adds the corresponding elements of the two matrices.

Limitations: Matrices must be the same dimensions

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D+%2B+%7B%7B2%2C+3%2C+4%7D%2C+%7B2%2C+3%2C+4%7D%7D
Spoiler For Subtraction:
Subtraction:

Subtracts each element from the matrix on the right from the corresponding element in the matrix on the left.

Limitations: Matrices must be the same dimensions

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D+-+%7B%7B2%2C+3%2C+4%7D%2C+%7B2%2C+3%2C+4%7D%7D
Spoiler For Multiplication:
Multiplication:

Multiplies the corresponding elements of the two matrices.

Limitations: Matrices must be the same dimensions

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D+*+%28%2B%7B%7B2%2C+4%2C+6%7D%2C+%7B2%2C+4%2C+6%7D%2C+%7B2%2C+4%2C+6%7D%7D%29
Spoiler For Division:
Division:

Divides each element from the matrix on the left by the corresponding element in the matrix on the right.

Limitations: Matrices must be the same dimensions and the matrix on the right must not contain a 0.

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D+%2F+%28%2B%7B%7B2%2C+4%2C+6%7D%2C+%7B2%2C+4%2C+6%7D%2C+%7B2%2C+4%2C+6%7D%7D%29
Spoiler For Exponentiation:
Exponentiation:

Raises each element from the matrix on the left to the power of the corresponding element in the matrix on the right.

Limitations: Matrices must be the same dimensions. If the matrix on the left contains any negative numbers, the corresponding element in the matrix on the left must be an integer power (since this is all Lua can handle). If it contains a zero, the corresponding element must be positive.

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+5%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D+**+%28%7B%7B2%2C+4%2C+6%7D%2C+%7B2%2C+4%2C+6%7D%2C+%7B2%2C+4%2C+6%7D%7D%29
Spoiler For Special Two Matrix Operations:
Special Two Matrix Operations:

Spoiler For Multiplication:
Multiplication:

The elements of the rows in the matrix on the left are multiplied with corresponding columns in the matrix on the right. Then they are added up and that is the element of the new matrix. This element is in the same numbered row as the row used from the matrix on the left and the same numbered column as the column used from the matrix on the right. It can be thought of as the dot product of the row vector and the column vector.

Limitations: The number of columns in the matrix on the left must be equal to the number of rows in the matrix on the right.

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D+*+%7B%7B2%2C+2%2C+2%7D%2C+%7B3%2C+3%2C+3%7D%2C+%7B4%2C+4%2C+4%7D%7D
Spoiler For One Matrix Operations and Properties:
One Matrix Operations and Properties:

Spoiler For Transpose:
Transverse:

For each element in a matrix, switch its row number with its column number. Switch the dimensions, also.

Limitations: none

Example: http://www.wolframalpha.com/input/?i=simplify+%7B%7B1%2C+2%2C+5%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D%5ET
Spoiler For Conjugate Transpose:
Conjugate Transpose:

The same as the transpose except it switches the sign on any imaginary values in the matrix. (6+4i becomes 6-4i). If all the elements in the matrix are real, then the conjugate transpose is the same as the transpose.

Limitations: none

Example: http://www.wolframalpha.com/input/?i=simplify+conjugate+transpose+%7B%7B1%2C+2%2B4i%2C+5i%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2-i%2C+3%7D%7D
Spoiler For Pseudoinverse:
Pseudoinverse:

Does this stuff http://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_pseudoinverse. It's a general inverse for all matrices regardless of their dimensions. The result of the product of the original and the pseudoinverse isn't necessarily the identity matrix, but if multiplied by the original matrix again, it will produce the original matrix. It always exists and is always unique. If the matrix is a non-singular square matrix, the pseudoinverse will be equal to the inverse (there is still a pseudoinverse for singular square matrices).

Limitations: none

Example: http://www.wolframalpha.com/input/?i=pseudoinverse+%7B%7B1%2C+2%2C+5%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D
Spoiler For Determinant:
Determinant:

The determinate has various geometric properties. The determinate of an inverse matrix is the the multiplicative inverse of the determinate of the original matrix. If the original determinate is zero, the matrix is singular.

Limitations: The matrix must be a square matrix

Example: http://www.wolframalpha.com/input/?i=simplify+determinant+%7B%7B1%2C+2%2C+5%7D%2C+%7B1%2C+2%2C+3%7D%2C+%7B1%2C+2%2C+3%7D%7D
Spoiler For Generatable Matrices:
Generatable(?) Matrices:

Spoiler For Identity Matrix:
Identity Matrix:

Generates a square matrix that has all 0s except for along the diagonal where it has 1s.

Limitations: It must be a square matrix (implying that it's dimensions will be positive integers).

Example: http://www.wolframalpha.com/input/?i=simplify+identity+matrix+5

Spoiler For Random Matrix:
Random Matrix:

Generates a matrix with specified dimensions and random elements between 0 and 1. (Other operations can be done if you want a different range or complex numbers)

Limitations: Its dimensions must be positive integers.

Example: http://www.wolframalpha.com/input/?i=random+6x2+matrix

Other functions:
ref()
rref()

There is also all the other various math functions. They all take one matrix as an argument and effect each element-by-element.

As far as complex numbers go, are there any useful functions that apply to complex numbers (cis and arccis for example). I would update the math library to include complex numbers too. I don't know what to do about the periodicity created by some operations, yet.  :-\

 :D  The End          (It's only the beginning) x.x

33
News / Re: TI-Nspire OS 3.2 is out!
« on: June 07, 2012, 10:12:02 pm »
- Windows Nspire 3.2 Student.
- Windows Nspire 3.2 Teacher.
- Mac Nspire 3.2 Student.
- Mac Nspire 3.2 Teacher.

(not PC/Mac software not uploaded yet...)

I just downloaded the student software from here, so the main news article should probably be updated. I don't know about the teacher software.

The script editor looks very handy for writing Lua. They also have updated documentation here for the new functions.

34
News / Re: Dive into Critor's TI collection...
« on: April 07, 2012, 02:27:11 pm »
I count:
2 view screens
1 CBL system
5 various cables
9 docking stations
29 lab cradles Edit: 39 lab cradles
1 wireless access point

more than 100 calcs

but only 99 calculators!
(I'm not sure what the thing in the lower left is)

Ninja'd by totorigolo.

35
TI-Nspire / Re: My first BASIC program- Pokemon Damage Calculator
« on: March 25, 2012, 09:42:12 pm »
Here is a link with all the minute details of damage calculation. http://www.smogon.com/dp/articles/damage_formula
You probably won't want to make it this complicated but it should have all the formulas you need. (This is for Diamond and Perl so the formulas could be slightly different depending on which generation you're writing the program for for)

It depends on how you want it to be used. If you want the inputs passed as arguments, I would say make a library full of functions. If you want the user to enter information in text boxes and such I would make one large program. Of course you could make both using your library functions in a program that collects the input from the user. Then you could use it both ways.

Good Luck!

36
OmnomIRC Development / Re: Omnom IRC down?
« on: March 22, 2012, 09:56:47 am »
It seems like it is working for me in Chrome now.

37
General Calculator Help / Re: Rotation- How does it work??
« on: March 12, 2012, 11:18:03 pm »
First of all, I have no idea what math teachers would say about any of this. I was playing around with some stuff, and I stumbled upon it. I read a few things to confirm I was right.

 There are ways of looking at it: rotating the coordinate system or rotating all the points. I think the second way is a bit more intuitive. That’s also the way I found it.



This is the basic setup for rotating a point.

First, we need to describe the point you want to rotate relative to the point of rotation and in terms of an angle from standard position.

Let’s say the original point has coordinates of (xi, yi) and the point of rotation has coordinates of (xcenter, ycenter).

Since unit circle trigonometry is based off a circle at the origin, let’s temporarily translate everything to the origin. Since we are working based on how the points are relative to the point of rotation and not a “fixed” point, we can move the whole system as long as we move it back. To do this, all we have to do is subtract (xcenter, ycenter) from both points. This puts the point of rotation at the origin and the other point at (xi- xcenter, yi - ycenter).

When you rotate an object around a point, the points are always the same distance from each other. This means if you draw a circle with the point of rotation at the center and the point you want to rotate on the circle, the rotated point will also be on the circle. Since we know the coordinates of the two points, we can use the distance formula to find this distance.

√((xi - xcenter)2 + (yi - ycenter)2)

Now by dropping a right triangle down from the point, we can find the angle between the point and standard position.

tan(θ) = o / h

tan(θ) = (xi - xcenter)/(yi - ycenter)

θ = arctan(xi - xcenter)/(yi - ycenter)

Now we have everything needed to express the original point using angles.

(Distance*cos(θ), Distance*sin(θ))

To rotate the point, just add the desired angle of rotation.

Since we have to move everything back to their original position, we need to add (xcenter, ycenter)

To put everything together, you would end up with these equations:

xnew = √((xi - xcenter)2 + (yi - ycenter)2)*cos(arctan(xi - xcenter)/(yi - ycenter)+ θrotation)+ xcenter

ynew = √((xi - xcenter)2 + (yi - ycenter)2)*sin(arctan(xi - xcenter)/(yi - ycenter)+ θrotation)+ ycenter

where (xnew, ynew) is the rotated point.

This looks terrible and is a pain to type so let’s simplify it. According to the linear combination of sine and cosine, a*sin(θ)+b*cos(θ)= √(a2+ b2)*cos(θ - arctan(b/a)).
The second half shows a very near resemblance to our two equations.

The shifts on the ends of the equations wouldn’t matter because if the above statement is true wouldn’t a*sin(θ)+b*cos(θ) + 5= √(a2+ b2)*cos(θ - arctan(b/a)) +5?

Starting with the x equation, a would be yi - ycenter because it is on the bottom of the fraction in the arctan.

That means that b is xi - xcenter

In this case we need to make θ =-θrotation so we can change the sign in front of the θrotation (a double negative)

Also because cos(θ)= cos(-θ) we can then distribute a negative through

xnew = √((xi - xcenter)2 + (yi - ycenter)2)*cos( (-θrotation)- arctan(xi - xcenter)/(yi - ycenter))+ xcenter

now that it matches the formula we can write it as

xnew = (yi - ycenter)*sin(-θrotation) + (xi - xcenter)*cos(-θrotation)  + xcenter

Because cos(θ)= cos(-θ) and -sin(θ)= sin(-θ) it can be written like

xnew = (xi - xcenter)*cos(θrotation) - (yi - ycenter)*sin(θrotation) + xcenter

It’s a similar process for the ys but we need to change the sine into a cosine

cos(θ)= sin(90-θ) because a right triangle’s angles add up to 180 and one is already 90 (pi and pi/2 if you prefer)

so in this case we need 90-θrotation instead (the negative distributes into the arctan but we need that negative anyway)

now that the sine is a cosine we can do the same thing as last time.

ynew = (yi - ycenter)*sin(90-θrotation) + (xi - xcenter)*cos(90-θrotation)  + ycenter

Now we can switch the sines (punny)

ynew = (yi - ycenter)*cos(θrotation) + (xi - xcenter)*sin(θrotation)  + ycenter

In the end these are the equations

xnew = (xi - xcenter)*cos(θrotation) - (yi - ycenter)*sin(θrotation) + xcenter

ynew = (yi - ycenter)*cos(θrotation) + (xi - xcenter)*sin(θrotation)  + ycenter

These are similar to the equations in the Wikipedia article (except those are for rotating around the origin).

To use these equations just plug in the coordinates of the points and make θrotation how much you want to rotate it by.

Just so you know it works to put other parametric equations in for (xi, yi) to rotate all the points in the equations thus rotating the equations

If anything needs clairification, I’m happy to explain. Once again I explored this by myself so I don’t know how it is taught in schools.


38
General Calculator Help / Re: Rotation- How does it work??
« on: March 12, 2012, 05:21:59 pm »
It's with polygons right? Do want an explanation of why it works or how to work it?

It will take a few minutes for me to prepare everything.

39
General Calculator Help / Re: Rotation- How does it work??
« on: March 12, 2012, 05:17:00 pm »
Is this the type of thing you're looking for?

http://en.wikipedia.org/wiki/Rotation_(mathematics)

40
News / Re: Site Updates and New Managment
« on: March 12, 2012, 12:48:24 am »
Congraulations to shmibs and qwerty on their promotion! :D
It's a nice change of pace from the past few weeks.

Also, I agree with the removal of the down-vote button. It would be nice to have a simple way of letting someone know they've made a mistake or have said something distaseful without making a big deal out of it or getting off topic, though.

41
Math and Science / Re: Why doesn't zero divided by zero work
« on: February 23, 2012, 05:23:09 pm »
I understand what you're saying. I learn about series next year.

Wolfram Alpha is great but it feels frustrating that it now costs money to use all of its cool new features (and a couple of its old features).
Since it's still getting new things added to it, it's fine that it doesn't always show exactly what I want, yet. (I'll wait until it can read minds.)

42
Math and Science / Re: Why doesn't zero divided by zero work
« on: February 23, 2012, 04:55:04 pm »
These are tricky (especially since I'm not very familiar with the hyperbolic trig functions), so I cheated and used Wolfram Alpha. http://www.wolframalpha.com/input/?i=lim_x-%3E0%281%2Fsin%28x%29%5E2-1%2Fsinh%28x%29%5E2%29
If you look in the steps, it uses L'Hôpital's rule.

Many functions need to be rewritten to properly use L'Hôpital's rule though.

I don't really understand the ones in Exercice 5-7 since I don't read french very well yet. They sort of look like integrals though.

43
Math and Science / Re: Why doesn't zero divided by zero work
« on: February 23, 2012, 04:30:22 pm »
(but sadly rarely usable on complex cases :( )

On what sort of cases is it unusable?

44
Math and Science / Re: Why doesn't zero divided by zero work
« on: February 23, 2012, 04:23:40 pm »
The division of zero is the reason why L'Hôpital's rule is necessary for finding some limits in calculus.

45
Humour and Jokes / Re: Translation Party!
« on: January 29, 2012, 05:33:22 pm »
A good quote to try:

As I would not be a slave, so I would not be a master. This expresses my idea of democracy. -Abraham Lincoln

Pages: 1 2 [3] 4 5 ... 8