--- title: "How to: Rotate an Object by Using a Geometric Path" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "geometric paths [WPF], rotating objects by" - "rotating objects by geometric paths [WPF]" ms.assetid: cb31ca4d-f05a-4c6b-9a18-4b6faaf38d45 --- # How to: Rotate an Object by Using a Geometric Path This example shows how to rotate (pivot) an object along a geometric path that is defined by a object. ## Example The following example uses three objects to move a rectangle along a geometric path. - The first animates a that is applied to the rectangle. The animation generates angle values. It makes the rectangle rotate (pivot) along the contours of the path. - The other two objects animate the and values of a that is applied to the rectangle. They make the rectangle move horizontally and vertically along the path. [!code-xaml[PathAnimationGallery_snippet#RotateAnimationUsingPathWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/PathAnimationGallery_snippet/CS/rotateanimationusingpathexample.xaml#rotateanimationusingpathwholepage)] [!code-csharp[PathAnimationGallery_procedural_snip#RotateAnimationUsingPathWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/PathAnimationGallery_procedural_snip/CSharp/RotateAnimationUsingPathExample.cs#rotateanimationusingpathwholepage)] [!code-vb[PathAnimationGallery_procedural_snip#RotateAnimationUsingPathWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/PathAnimationGallery_procedural_snip/VisualBasic/RotateAnimationUsingPathExample.vb#rotateanimationusingpathwholepage)] Another way to rotate an object by using a geometric path is to use a object and set its property to `true`. For more information and an example, see [Rotate an Object by Using a Geometric Path (Matrix Animation)](how-to-rotate-an-object-by-using-a-geometric-path-matrix-animation.md). For the complete sample, see [Path Animation Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Animation/PathAnimations). ## See also - [Animation Overview](animation-overview.md) - [Path Animation Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Animation/PathAnimations) - [Path Animation How-to Topics](path-animation-how-to-topics.md)