To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10406
10405  |  10407
Subject: 
Simple Maths Help Needed
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 4 Feb 2006 23:32:14 GMT
Viewed: 
2228 times
  
I'm ashamed to admit, but I have got stuck in a quite simple Maths problem.
It's all about an implementation of the basic formula y=kx+m, but somehow I have
managed to think the wrong way. Luckily, I made problems like this in a glanse
back in school...

Background; I wish to create a Tweening command.
For example:
Object.Tween Object.Progress from to start_value end_value
Minifig01.LeftArm.Angle.Tween Minifig01.Progress 0 0.25 0 40
...where Minifig01.Progress is the given x value and from and to is the other x
values corresponding to start_value and end_value on the y-axis.

So, at the from value Progress=0, we read start_value=0 degrees.
When Progress reaches the end_value=0.25, we get 40 degrees.
At Progress=0.125, the angle=20 deg's.

This is very simple, I know, but I insist on doing it wrong every time!
So, I have to humble myself and ask for the formula for this quite basic
implementation.


TIA,
/Tore



Message has 1 Reply:
  Re: Simple Maths Help Needed
 
(...) I think what you want is: value = start_value + ((end_value - start_value) * (Progress - from) / (to - from)) HTH ROSCO (19 years ago, 4-Feb-06, to lugnet.cad.dev)

5 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR