Animation functions?



 Science > Physics > Animation functions?

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: Science > Physics
User: ""
Date: 31 Jan 2008 12:05:53 PM
Object: Animation functions?
I want to make some functions that take a floating point number [0-1]
and return an affected number, based on the input.
For example:
function accel(i) {
return i*i;
}
accel( .2 ); //0.04
accel( .5 ); // 0.25
accel( .8 ); // 0.64
accel( .99 ); // 0.998001
I want to make more of these, I want one that starts slow, speeds up,
then slows down.
My wife told me to use a sigmoid function. We checked Wikipedia but
we're not smart enough to figure it out:
http://en.wikipedia.org/wiki/Sigmoid_function
This page is almost understandable to me. I want to try and figure out
how to make a function that returns numbers liek that:
http://www.frams.alife.pl/a/al_simdetail.html
I don't undertstand the suscript numbers/letters
Velocity(t), where (t) is subscript.
What does that mean?
How can I write a sigmoid function or set of functions?
.

User: "Uncle Al"

Title: Re: Animation functions? 31 Jan 2008 01:24:20 PM
wrote:


I want to make some functions that take a floating point number [0-1]
and return an affected number, based on the input.

For example:
function accel(i) {
return i*i;
}

accel( .2 ); //0.04
accel( .5 ); // 0.25
accel( .8 ); // 0.64
accel( .99 ); // 0.998001

I want to make more of these, I want one that starts slow, speeds up,
then slows down.

KISS,
[sin([0,1]x)], x = 180 degrees or pi radians
[sin([0,1]x)]^2, x = 180 degrees or pi radians for sharper
acceleration
sqrt{[sin([0,1]x)]}, x = 180 degrees or pi radians for gentler
accleration
If you need a *special* shape, sweat it out.

My wife told me to use a sigmoid function. We checked Wikipedia but
we're not smart enough to figure it out:
http://en.wikipedia.org/wiki/Sigmoid_function

This page is almost understandable to me. I want to try and figure out
how to make a function that returns numbers liek that:
http://www.frams.alife.pl/a/al_simdetail.html

I don't undertstand the suscript numbers/letters
Velocity(t), where (t) is subscript.

What does that mean?

How can I write a sigmoid function or set of functions?

--
Uncle Al
http://www.mazepath.com/uncleal/
(Toxic URL! Unsafe for children and most mammals)
http://www.mazepath.com/uncleal/lajos.htm#a2
.
User: "dhtml"

Title: Re: Animation functions? 31 Jan 2008 07:28:00 PM
On Jan 31, 11:24 am, Uncle Al <Uncle...@hate.spam.net> wrote:

fitcal...@gmail.com wrote:

I want to make some functions that take a floating point number [0-1]
and return an affected number, based on the input.


For example:
function accel(i) {
return i*i;
}


accel( .2 ); //0.04
accel( .5 ); // 0.25
accel( .8 ); // 0.64
accel( .99 ); // 0.998001


I want to make more of these, I want one that starts slow, speeds up,
then slows down.


KISS,

[sin([0,1]x)], x = 180 degrees or pi radians
[sin([0,1]x)]^2, x = 180 degrees or pi radians for sharper
acceleration
sqrt{[sin([0,1]x)]}, x = 180 degrees or pi radians for gentler
accleration

How should I interpret that?
I know that |^| means "to the power of",
but I don't know:
[ ]
,
x
( )
{}
In programming, () are for grouping, {} is for a block of code and []
depends on the context its used in.
I dont know what the symbols are to indicate.
I really don't understand.
Thank you.


--
Uncle Alhttp://www.mazepath.com/uncleal/
(Toxic URL! Unsafe for children and most mammals)http://www.mazepath.com/uncleal/lajos.htm#a2

.
User: "Uncle Al"

Title: Re: Animation functions? 31 Jan 2008 08:28:23 PM
dhtml wrote:


On Jan 31, 11:24 am, Uncle Al <Uncle...@hate.spam.net> wrote:

fitcal...@gmail.com wrote:

I want to make some functions that take a floating point number [0-1]
and return an affected number, based on the input.


For example:
function accel(i) {
return i*i;
}


accel( .2 ); //0.04
accel( .5 ); // 0.25
accel( .8 ); // 0.64
accel( .99 ); // 0.998001


I want to make more of these, I want one that starts slow, speeds up,
then slows down.


KISS,

[sin([0,1]x)], x = 180 degrees or pi radians
[sin([0,1]x)]^2, x = 180 degrees or pi radians for sharper
acceleration
sqrt{[sin([0,1]x)]}, x = 180 degrees or pi radians for gentler
accleration

How should I interpret that?

I know that |^| means "to the power of",
but I don't know:
[ ]
,
x
( )
{}

In programming, () are for grouping, {} is for a block of code and []
depends on the context its used in.

I dont know what the symbols are to indicate.

I really don't understand.

Insert the desired coefficient, between 0 and 1 inclusive, in front of
x.
x would be 90 or pi depending on how you like your trig functions.
--
Uncle Al
http://www.mazepath.com/uncleal/
(Toxic URL! Unsafe for children and most mammals)
http://www.mazepath.com/uncleal/lajos.htm#a2
.
User: "dhtml"

Title: Re: Animation functions? 02 Feb 2008 12:55:26 AM
On Jan 31, 6:28 pm, Uncle Al <Uncle...@hate.spam.net> wrote:

dhtml wrote:

On Jan 31, 11:24 am, Uncle Al <Uncle...@hate.spam.net> wrote:

fitcal...@gmail.com wrote:


I want to make some functions that take a floating point number [0-1]
and return an affected number, based on the input.


For example:
function accel(i) {
return i*i;
}


accel( .2 ); //0.04
accel( .5 ); // 0.25
accel( .8 ); // 0.64
accel( .99 ); // 0.998001


I want to make more of these, I want one that starts slow, speeds up,
then slows down.


KISS,


[sin([0,1]x)], x = 180 degrees or pi radians
[sin([0,1]x)]^2, x = 180 degrees or pi radians for sharper
acceleration
sqrt{[sin([0,1]x)]}, x = 180 degrees or pi radians for gentler
accleration


How should I interpret that?


I know that |^| means "to the power of",
but I don't know:
[ ]
,
x
( )
{}


In programming, () are for grouping, {} is for a block of code and []
depends on the context its used in.


I dont know what the symbols are to indicate.


I really don't understand.


Insert the desired coefficient, between 0 and 1 inclusive, in front of
x.

http://en.wikipedia.org/wiki/Coefficient
OK. I think I get it.


x would be 90 or pi depending on how you like your trig functions.

(Math.sin( 1 ) * Math.PI)
2.643559064081456
Math.pow((Math.sin( 1 ) * Math.PI), 2)
6.988404525287224
If 1 is input, 1 should be output, so that would end with the wrong
position. I want to modify the function so I can use it. Can you help
me understand the math?
thx

--
Uncle Alhttp://www.mazepath.com/uncleal/
(Toxic URL! Unsafe for children and most mammals)http://www.mazepath.com/uncleal/lajos.htm#a2

.





  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1612     pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER