Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2009-10-27 04:11:02

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Expression Formula

I'm trying to figure out how to apply an expression.  When dealing with Sin and so forth but I don't even know how to ask the question smile I'm hoping someone can help me it deals with expressions in software programs and how to type out the expression as I have no clue, hopefully someone has a insight as to the direction I could take which hopefully could narrow down my question to more specific smile

Thank You

Offline

#2 2009-10-27 04:33:44

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

I'm trying to figure out how to apply an expression

Can you post the expression you are working on? Can you post a little more pertaining to what is the problem?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2009-10-27 12:48:28

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

Well when I'm typing an expression and I'll use something simple

Sin(Fc*5) now in relation to what I'm doing I understand what the Fc means for the software but is it specific to the software how to write a expression formula out ? Or is there a General rule that one could use most of these formulas have some ties with Javascript if that helps.

Offline

#4 2009-10-27 13:13:42

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

As far as I understand your question it would be specific to the software. I have seen sin(Fc * 5) or Sin(Fc *5) or even sine(Fc * 5), if you are entering these as input for a program.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2009-10-27 15:37:43

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

Oh so you would have to learn in relation to the program ? You couldn't just use any formula and it would work each program would have a specific formula to use !

Offline

#6 2009-10-28 02:50:52

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi Superlynx;

True, but they are all pretty close.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#7 2009-10-28 07:46:02

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

Do you know what could help me in relation to grasping these commands?

Offline

#8 2009-10-28 07:58:21

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

Every program of that type has extensive help. I mean enough documentation to fill a book. That's the first place I would look. Then go to to the site and look for online help or forums for that program. What program is it?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#9 2009-10-28 11:57:58

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

It's a 3D program.  I'm just having a hard time understanding that is unless if you were supplied some documentation you could help me ?

Offline

#10 2009-10-29 03:59:33

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

You are missing my point. The proggie itself will have tons of documentation. Just pull down the help menu. Or as I said, try the site. They will have FAQ's and forums where you can ask any question even the most basic. Also maybe that proggie is too advanced, you might think about one that is simpler. Google for other 3D programs that are more intuitive. This is the best I can do in the general sense.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#11 2009-10-29 04:45:48

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

I'll just look over the documentation.  Thanx.

Offline

#12 2009-10-29 04:47:19

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

Yes, start there! Go through the beginning examples. Take the tour of the proggie if they have one. Everyone who starts out learning every program must do this. There are no shortcuts. Tell me about your general progress.

Last edited by bobbym (2009-10-29 04:48:40)


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#13 2009-10-29 11:29:01

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

I'm going to read up and any questions, I'll let you know about that I don't understand by posting the way the manual states and what I don't understand, this will probably make it easier for you and for me so I can understand smile

Offline

#14 2009-11-02 17:55:23

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

And now for a simple oscillation using the cosine function and the frame rate of the scene’s playback.

The expression you see above this sentence is with a variable which has been written in the expression. 

MIN( <val1> , <val2> )

noise( <x>, <y>, <z> )


This expression sets a Cosine curve based on a variable on time (T equals Time) multiplying by 90 by the variables which is
the sphere.Control.freq <multiple> by another variable which is sphere.Control.amp. 

Using this example how would you put, within this expression
this code:

and this ?

Offline

#15 2009-11-03 02:01:30

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

Any language or most any program should just let you do this.

I am not saying that's going to be pleasing but it is allowed. You could even do:

Provided that noise and MIN return legal values. Generally you can nest functions inside other functions or in expressions as deep as you like.

Last edited by bobbym (2009-11-03 02:08:09)


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#16 2009-11-03 02:56:13

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

cos( T * 90 *MIN( noise( 45, 34, 25 ))
without any variable I'm trying this expression but it throws back an error

Offline

#17 2009-11-03 03:59:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi;

cos( T * 90 *MIN( noise( 45, 34, 25 ))

The function MIN takes 2 parameters or arguments and returns the smaller of the 2.
Ex:
MIN(3,2) = 2

noise probably returns only a single value. So what is happening is whatever noise is returning is not 2 parmeters and that is what MIN wants.

Try noise( 45, 34, 25 ) and see what it returns. Or check the help.

Last edited by bobbym (2009-11-03 03:59:49)


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#18 2009-11-03 04:23:09

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

Noise doesn't do anything because there is nothing driving the noise.  The expression noise(45,34,25) works but nothing is going to happen because there is nothing to drive the noise.

Offline

#19 2009-11-03 04:26:36

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

Yes, but what does return, when it does work. Check your help. You know it needs 3 arguments x,y,z) so what does it say it returns. As I have said you are probably not calling MIN with the required 2 arguments.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#20 2009-11-03 05:39:27

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

The expression doesn't return nothing, and the expression does work.  There is three arguments, in the noise that I have in place.  I don't understand how I would apply MIN within and remember that noise would have to work on a Cos or Sine.  In this step all that I've done is applied "noise 45,34,25" representing X,Y,Z.

Offline

#21 2009-11-03 06:04:16

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

cos( T * 90 *MIN( noise( 45, 34, 25 ))

What I am trying to say is that noise is not returning the two parameters than MIN requires. There may be other errors but let's concentrate on this one.

MIN(32,8) returns 8
MIN(32) returns an error. MIN expects 2 things and got one.

When I showed you how to nest one function inside another that was just an example. You have to obey the syntax for each command.

Without knowing the particulars of your program it is hard to be specific but you could nest the cosine function inside of MIN:

MIN(cos(.3),cos(.5)) should return a value.

Last edited by bobbym (2009-11-03 06:04:52)


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#22 2009-11-03 12:31:04

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

Good Afternoon or Day Bobby smile

What I am trying to say is that noise is not returning the two parameters than MIN requires. There may be other errors but let's concentrate on this one.

MIN(32,8) returns 8
MIN(32) returns an error. MIN expects 2 things and got one.

This I now understand, MIN expects 2 things and it uses the lowest number, correct?

When I showed you how to nest one function inside another that was just an example. You have to obey the syntax for each command.

Without knowing the particulars of your program it is hard to be specific but you could nest the cosine function inside of MIN:

MIN(cos(.3),cos(.5)) should return a value.

This expression worked, what you did was using the MIN command you nested a cos command with the first value for the MIN then a second cos with the second part of the function for MIN.  Why did you put (.3) & (.5) in brackets ? Lets suppose that I wanted to make a sphere have a Cos with noise how come this wouldn't work:

Cos(noise 45,23,12) ?

Here are some of the basic functions that are within this software:

+ Add
– Subtract
* Multiply
/ Divide
% Modulo (remainder)

Abs()
Absolute value

Cos()
Cosine

Fix(), Int()
Integer portion of a number

Log()
Natural logarithm

Rnd()
Random number

Sgn()
The sign of a number: –1, 0, or 1

Sin()
Sine

Sqr()
Square root

Tan()
Tangent


Fc = Current Frame
Fc = Start Frame

Now How would you go about, with a cosine curve but have the cosine curve become flat at times then go into the curve.  Imagine if you draw a constant curve, now you draw some random flat peaks that would be at zero.  Would the MIN with COS and NOISE be used to control this ? How would you write this out ?

Thank You.

Offline

#23 2009-11-03 21:22:09

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

HI Superlynx;

Why did you put (.3) & (.5) in brackets ?

Although this varies the command should look something like this cos( <some number> )

Cos(noise 45,23,12) ?

First, according to post #14 you are violating the syntax for the noise command. You forgot the parentheses around the 45,23,12. You must obey the rules with no exceptions. Also cos is the Cosine function. It expects a number as input. cos(.5), cos(.3), cos(1.6) are all legal. cos( pizza ) is illegal unless pizza is a variable that equals a number.

cos( noise(.1,.2,.3) ) might error because noise() does not return a number for cos to work on.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#24 2009-11-03 22:55:13

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Expression Formula

Hi, Bobbym smile

In post #22 I put the noise function within a bracket for Cos as you put Cos(45,23,12).  How come you have Cos(.5), cos(.03), cos(1.6) why do it that way ? I haven't tried that expression Cos( noise(.1,.2.,.3)) but I think you may be right in that it will return an error but why would it ?  Remember post #22 has most of the expression commands smile

Now How would you go about, with a cosine curve but have the cosine curve become flat at times then go into the curve.  Imagine if you draw a constant curve, now you draw some random flat peaks that would be at zero.  Would the MIN with COS and NOISE be used to control this ? How would you write this out ?

Offline

#25 2009-11-04 09:53:07

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Expression Formula

Hi SuperLynx;

In post #22 I put the noise function within a bracket for Cos as you put Cos(45,23,12)

Nope, I never did that except to show what is wrong with it. Cos takes one argument not three. You have to understand this. Also arguments must be of the correct type Cos(pizza) makes no sense Cos (1.5) does. The arguments are the things in the parentheses that are separated by commas. You need much more work with the help examples. Have you read the help entirely?

Now How would you go about, with a cosine curve but have the cosine curve become flat at times then go into the curve.  Imagine if you draw a constant curve, now you draw some random flat peaks that would be at zero.  Would the MIN with COS and NOISE be used to control this ? How would you write this out ?

This is many levels ahead. The simplest way to do it would be with a piecewise function. We could create one using if then statements. This would not make any sense to you right now.

When trying to learn a programming language there is no short way. You must get familiar with the commands and the syntax the language provides. This is mandatory. You cannot make mistakes like using cos(3.4) instead of Cos(3.4). You cannot replace noise(.1,.2,.3) with noise .1,.2,.3

You must learn to walk a step before you can run a mile

I used to speak about ten programming languages. I had to learn each one in the manner I am telling you. You or anyone else will have no success without a thorough understanding of the syntax and the commands. We can go on another 30000 posts and no headway will be made. Sorry to be gruff but I must get this point across.

There is definitely FAQ's and help forums for this particular program / language ( if it is a major program ), look for them. They will help you get started.

Last edited by bobbym (2009-11-04 09:57:11)


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB