Witam
Muszę zaimplementować dwie kilka klas do interfejsu, mam problem jak ugryźć interpolacje dla
System.Windows.Media.Color (tu chyba chodzi o RGB), System.Windows.Media.Media3D.Point3D i System.Windows.Media.Media3D.Vector3D
Mam zrobione np dla float:
(IInterpolator.cs)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Nazwa.Interpolators
{
public interface IInterpolator
{
object Interpolate(object from, object to, double ratio);
}
}
(FloatInterpolator.cs)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Nazwa.Interpolators
{
public class DoubleInterpolator : IInterpolator
{
#region IInterpolator Members
public object Interpolate(object from, object to, double ratio)
{
var fromD = (float)from;
var toD = (float)to;
return fromD + (toD - fromD) * ratio;
}
#endregion// IInterpolator Members
}
}
Prosiłbym o wskazówki jak mam do tego podejść.
Z góry wielkie dzięki.