Silverlight Radian Rotation in VB.NET

In this article you will learn about the Radian Rotation in silverlight.
  • 1671

 Radian RotationAs you learn in my previous article Silverlight provides the four transform classes which is used for transformations. All of them can be grouped into a single TransformGroup to apply multiple transformations to a single object. A Transform defines how to map, or transform, points from one coordinate space to another coordinate space.

Now we talk about the Degree Radian Rotation its very important when we go to use the Degree Radian Rotation because while Blend/XAML will take angular measurements in degrees, any rotations you do via trigonometric functions will give you radians, and you will get unexpected results if you forget to convert between the two units.

Example of Radian Rotation

<UserControl x:Class="SilverlightApplication20.MainPage"
     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
    xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
    xmlns:d='http://schemas.microsoft.com/expression/blend/2008' 
    xmlns:mc='http://schemas.openxmlformats.org/markup-compatibility/2006' 
    mc:Ignorable='d' 
    d:DesignWidth='640' d:DesignHeight='480'>
    <UserControl.Resources>
        <Storyboard x:Name="MoveTimer" Duration="00:00:00.03"/>
    </UserControl.Resources>
    <Canvas x:Name="LayoutRoot" Width="800" Height="600">
        <Canvas.Background>
            <LinearGradientBrush EndPoint="0.3,1" StartPoint="0.4,0">
                <GradientStop Color="AliceBlue" Offset="0.009"/>
                <GradientStop Color="#FF000000" Offset="1"/>
            </LinearGradientBrush>
        </Canvas.Background>
        <Ellipse Height="150" Width="150" Stroke="Red" Canvas.Left="223" Canvas.Top="73"x:Name="one"/>
        <Ellipse Height="150" Width="150" Stroke="Yellow" x:Name="two" Canvas.Left="223"Canvas.Top="293"/>
        <TextBlock Text="Degrees: 0" TextWrapping="Wrap" Canvas.Top="133" Canvas.Left="98"Foreground="#FFFFFFFF" Width="118.695" 
Height
="27" x:Name="MsgDegrees"/>
        <TextBlock Text="Radians: 0" TextWrapping="Wrap" Foreground="#FFFFFFFF"Width="118.695" Height="27" x:Name="MsgRadians" 
Canvas.Left
="98" Canvas.Top="377"/>
    </Canvas>
</
UserControl>

Output Window

r.gif
 

Conclusion

Hope this article would help you understand how to Perform Radian Rotation in Silverlight.

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.