1
00:00:00,450 --> 00:00:05,100
Hi guys we continue from the previous lecture and the lecture.

2
00:00:05,100 --> 00:00:09,790
We added that we go for the rotation and we set it to to 150.

3
00:00:09,870 --> 00:00:12,250
And we looked at the graph just over here.

4
00:00:12,320 --> 00:00:18,810
We noticed we have a beautiful graph with certain maximum values on negative and positive.

5
00:00:19,170 --> 00:00:23,860
If you haven't done so please add the wiggle here so we can continue our enemy.

6
00:00:24,090 --> 00:00:27,480
Our aim in this lecture is to animate the knob over here.

7
00:00:27,630 --> 00:00:30,030
You want the knob to wiggle with the needle.

8
00:00:30,150 --> 00:00:32,180
The needle goes on the right for example.

9
00:00:32,180 --> 00:00:36,130
Then up would come over here if it goes on the left somewhere.

10
00:00:36,180 --> 00:00:37,370
Let's say over here.

11
00:00:37,680 --> 00:00:39,600
The knob will go over here.

12
00:00:39,600 --> 00:00:44,900
So actually the knob would be whittling ways the needle could undo this.

13
00:00:45,000 --> 00:00:51,360
And here we are going to interpret the rotation to position you might be asking that we did already

14
00:00:51,440 --> 00:00:55,380
an interpellation over here in this animation.

15
00:00:55,380 --> 00:01:00,180
We interpolated the exposition into the rotation.

16
00:01:00,270 --> 00:01:07,620
So we have taken the position zero which is X interpretated return it to the rotation and that was the

17
00:01:07,620 --> 00:01:11,200
only single value we needed for the rotation to operate.

18
00:01:11,520 --> 00:01:14,040
Well here it's a bit different.

19
00:01:14,070 --> 00:01:18,540
You are going to interpolate the rotation into the x value.

20
00:01:18,870 --> 00:01:19,490
That's true.

21
00:01:19,560 --> 00:01:24,310
But then you need to return to values one for the x y for the Y.

22
00:01:24,360 --> 00:01:26,040
You cannot keep any of them.

23
00:01:26,190 --> 00:01:31,590
Both of them must be returned how to read the expression here could be a bit tricky.

24
00:01:31,700 --> 00:01:34,950
And as soon as I show you you will notice that it's so easy.

25
00:01:35,240 --> 00:01:37,960
So let's that our press Alt.

26
00:01:38,070 --> 00:01:41,250
If you are on the Mac press option click on the stopwatch.

27
00:01:41,340 --> 00:01:48,960
We are into the expression and of course I'm going to go up and bring the linear interpolation put it

28
00:01:49,030 --> 00:01:54,340
over to what is the T is the value that we want to interpret.

29
00:01:54,460 --> 00:01:55,270
In this case.

30
00:01:55,300 --> 00:01:57,170
It's going to be the rotation.

31
00:01:57,430 --> 00:02:00,720
So I will use the big sweep to pick the rotation.

32
00:02:00,850 --> 00:02:01,800
OK.

33
00:02:02,300 --> 00:02:04,270
Now what is D.M..

34
00:02:04,390 --> 00:02:10,240
What we know from the graph that we can discover what is Dimino let's go have a look for the rotation

35
00:02:10,370 --> 00:02:11,450
here.

36
00:02:11,650 --> 00:02:15,060
This is of course we are in the value graph guys.

37
00:02:15,070 --> 00:02:21,520
Now if you're not this scrap through you'll see that the minimum here are the minimum value here is

38
00:02:21,880 --> 00:02:26,820
minus 84 and the maximum value is a plus 67.

39
00:02:27,100 --> 00:02:31,610
This is for me maybe when you are working you might have different values.

40
00:02:31,650 --> 00:02:35,250
It doesn't have to be identical values to my.

41
00:02:35,340 --> 00:02:44,020
So we said minus 85 or minus 84 and you know minus 60 to maybe we take minus 85 and 85.

42
00:02:44,130 --> 00:02:45,460
That will be called.

43
00:02:45,480 --> 00:02:55,570
So the T.M. man will be I will delete the minimum minus 85 and the maximum is going to be Plus 85.

44
00:02:55,710 --> 00:02:59,870
You can put the minimum and the maximum which any value you want to find in your graph.

45
00:03:00,000 --> 00:03:02,900
And if you are more precise the animation will look a bit better.

46
00:03:03,960 --> 00:03:08,180
Value what is the value of the knob on the team here.

47
00:03:09,110 --> 00:03:12,740
So I will select the knob and go to the beginning.

48
00:03:12,740 --> 00:03:17,040
This is where I want the minimum to be and that is 246.

49
00:03:17,220 --> 00:03:19,630
I'll put it at 250.

50
00:03:19,880 --> 00:03:26,220
I'll put a 250 value to is the value of the knob on the x axis just over here.

51
00:03:26,500 --> 00:03:27,010
OK.

52
00:03:27,110 --> 00:03:29,120
Which is around one thousand sixty two.

53
00:03:29,170 --> 00:03:33,920
They say 1000 it will work nicely here 1000.

54
00:03:34,010 --> 00:03:36,090
Now you might say OK it's done.

55
00:03:36,320 --> 00:03:42,710
Actually it's not done because here you are returning a single value just the interpellation into the

56
00:03:42,710 --> 00:03:47,210
position which requires two values x and y.

57
00:03:47,660 --> 00:03:54,630
You need to work on the expression here to return the two values we are going to start using variables.

58
00:03:54,720 --> 00:04:02,440
The first valuable I'm going to call it X because of the exposition is equal to the linear interpolation.

59
00:04:02,460 --> 00:04:06,910
Now I need to add another value within the expression which is for the y axis.

60
00:04:06,930 --> 00:04:09,550
So let's go ahead we say y equal.

61
00:04:09,870 --> 00:04:12,270
And actually I'm going to pick up.

62
00:04:12,540 --> 00:04:17,800
If you do Equipe then you can choose the position up and down of the up.

63
00:04:17,880 --> 00:04:24,360
If you do not pick up then you put a rigid value like 1000 5000 whatever you like.

64
00:04:24,480 --> 00:04:26,280
Then later on you won't be able to change it.

65
00:04:26,280 --> 00:04:29,930
You have to go back to the expression itself.

66
00:04:29,960 --> 00:04:32,660
So now it's time to return these values.

67
00:04:32,760 --> 00:04:37,580
You are going to return unary which is made of two values to return unary.

68
00:04:37,670 --> 00:04:39,320
Use the square brackets.

69
00:04:39,410 --> 00:04:46,240
You open the square bracket you say return x so X will go to the X not because it's called X.

70
00:04:46,400 --> 00:04:54,260
But the first one will go to the position 0 and the second value will go to position 1 and you close

71
00:04:54,260 --> 00:04:55,440
the bracket.

72
00:04:55,460 --> 00:05:00,140
What that looks neat but it's not done yet in javascript.

73
00:05:00,170 --> 00:05:03,880
You need to end the line with a semicolon.

74
00:05:04,160 --> 00:05:09,760
This is for the interpreter to read this line and knows where the line end and then interprets it.

75
00:05:09,770 --> 00:05:10,930
That's how it works.

76
00:05:10,940 --> 00:05:15,810
So the semicolon will help identifying the end of line over here.

77
00:05:15,810 --> 00:05:17,780
Also you need to put semicolons.

78
00:05:17,780 --> 00:05:23,960
This is the end of line and then x y you don't need to put a semicolon here because there is nothing

79
00:05:23,960 --> 00:05:27,150
after and obviously is the end of the line.

80
00:05:27,360 --> 00:05:28,780
This click outside.

81
00:05:29,130 --> 00:05:36,060
There's a press space bar in play here you are it's working at 100 percent.

82
00:05:36,110 --> 00:05:43,520
So this lecture was about how to use variables x and y and how to return and area with two values as

83
00:05:43,520 --> 00:05:44,480
simple as this.

84
00:05:44,630 --> 00:05:50,020
So now you know how to interpret it between a single value to an area with two values.

85
00:05:50,810 --> 00:05:52,100
Thank you very much for listening.

86
00:05:52,100 --> 00:05:58,040
I hope you will use the techniques I showed you here and create some fantastic positions.

87
00:05:58,100 --> 00:05:59,380
I will see you in the next lectures.
