2017-06-25 23:05:48 +02:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
|
|
|
|
|
// © 2017 Clemens Fischer
|
|
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
internal static class MatrixEx
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2017-07-25 21:21:47 +02:00
|
|
|
|
/// Used in MapProjection and MapTileLayer.
|
2017-06-25 23:05:48 +02:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static Matrix TranslateScaleRotateTranslate(
|
2017-07-25 20:21:02 +02:00
|
|
|
|
double translation1X, double translation1Y,
|
|
|
|
|
|
double scaleX, double scaleY, double rotationAngle,
|
|
|
|
|
|
double translation2X, double translation2Y)
|
2017-06-25 23:05:48 +02:00
|
|
|
|
{
|
2017-08-04 21:38:58 +02:00
|
|
|
|
var matrix = new Matrix(1d, 0d, 0d, 1d, translation1X, translation1Y);
|
2017-06-25 23:05:48 +02:00
|
|
|
|
matrix.Scale(scaleX, scaleY);
|
|
|
|
|
|
matrix.Rotate(rotationAngle);
|
2017-07-25 20:21:02 +02:00
|
|
|
|
matrix.Translate(translation2X, translation2Y);
|
2017-06-25 23:05:48 +02:00
|
|
|
|
return matrix;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|