I think all we can do is to relate Math and Programming together.
Fortunately, my PureMath teacher has taught about a set of parametric equations which declare a path of circle. Then I try to implement it on Silverlight. Finally, it works, and I my extremely happy with that. Here is the solution.
XAML
[sourcecode language='xml']
...
[sourcecode language='xml']
C#:
[sourcecode language='csharp'] int t = 0;
double AniX;
double AniY;
void Page_Loaded(object sender, RoutedEventArgs e)
{
Ellipse_ani_X.From = Ellipse_ani_Y.From = 0;
Ellipse_ani_Y.To = Ellipse_ani_X.To = AniX = AniY = 0;
t++;
myStory_Ellipse.Begin();
}
private void Ellipse_ani_X_Completed(object sender, EventArgs e)
{
myStory_Ellipse.Stop();
Ellipse_ani_X.From = AniX;
Ellipse_ani_X.To= AniX = Math.Cos(t * Math.PI / 50 ) * 100;
Ellipse_ani_Y.From = AniY;
Ellipse_ani_Y.To = AniY = Math.Sin(t * Math.PI / 50 ) * 100;
t++;
myStory_Ellipse.Begin();
}
private void Ellipse_ani_Y_Completed(object sender, EventArgs e)
{
}[/sourcecode]
I am trying to work out the motion path solution. I hope it will help all of you.
Regards,
Steve Wong(Hong Kong)
Live with Light!







4 comments:
Author: Michael Tim
I love your site!
_____________________
Experiencing a slow PC recently? Fix it now!
Author: How to Get Six Pack Fast
After reading through the article, I feel that I need more information on the topic. Could you share some resources please?
Author: Liza
I can tell that this is not the first time you write about this topic. Why have you chosen it again?
Author: 3water
What do you mean by chosen it again?
Actually, I am the first time write about this. I dont know if someone has written it or not.
Post a Comment