tailieunhanh - Foundation Silverlight 3 Animation- P9

Foundation Silverlight 3 Animation- P9: Silverlight has really come a long way since I started using it. It’s kind of interesting to look back a mere two years (roughly) and think about how the workflow has changed. Of even more interest is the staggering speed at which new features are being added. In the time I’ve been using Silverlight, it has grown from a somewhat limited toolset to an ever-more-impressive technology that has really started to come into its own. | USING TRIGONOMETRY FOR ANIMATION Sine Sin An angle s sine is the ratio of the angle s opposite side to the hypotenuse. To calculate the sine of an angle with code we use the built-in sine function of C AnglelnRadians So in code assuming our conversion functions are in place we would use the following DegreesToRadians 35 And we get . This does not seem like a meaningful number at first glance does it This number describes the relationship of the opposite side of the triangle to the hypotenuse. What we have determined is that sine 35 opposite hypotenuse. We now know that for any right triangle that has a 35-degree angle the ratio of the opposite side to the hypotenuse will be . I know you re waiting for me to explain how this helps us. Let s assume the hypotenuse of our triangle is 15 feet long. How long is the opposite side sine 35 opposite hypotenuse In order to solve for the opposite side we multiply both sides of this equation by the hypotenuse. This effectively negates the hypotenuse in the right side of the equation see Figure 6-7 . sine 35 x hypotenuse opposite hypotenuse x hypotenuse x hypotenuse opposite hypotenuse x hypotenuse X hypotenuse opposite X 15 opposite opposite Figure 6-7. The sine of our angle multiplied by the length of the hypotenuse gives us the length of the opposite side. So there you have it we just used the sine function to figure out how long the opposite side of a triangle is. We ll put this into a Silverlight context in a bit right now we re going to move on to the cosine function. 221 CHAPTER 6 Cosine Cos The cosine function is the ratio of the angle s adjacent side to the hypotenuse. To calculate the cosine of an angle with code use the built-in cosine function of C see Figure 6-8 AnglelnRadians Once again assuming our degrees radians conversion functions are in place we would use the following .

TÀI LIỆU MỚI ĐĂNG
185    129    0    16-06-2024
6    130    0    16-06-2024
20    113    0    16-06-2024
24    102    0    16-06-2024
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.