public void Distance_Entre_Plusieur_Points()//Distance réel parcourue { listePoint.Add(new DataPosition(25.4, 33)); double distance1 = Math.Sqrt(Math.Pow(listePoint[1].X - listePoint[0].X, 2) + Math.Pow(listePoint[1].Y - listePoint[0].Y, 2)); double distance2 = Math.Sqrt(Math.Pow(listePoint[2].X - listePoint[1].X, 2) + Math.Pow(listePoint[2].Y - listePoint[1].Y, 2)); Assert.AreEqual(distance1 + distance2, Ax_Position.Distance(listePoint)); }
private void Calculs(List <ExerciceEvaluation> exoEvalList, List <DataPosition> tempDataFilted, ref SingletonReeducation ValeurReeducation) { //Calculs tabVitMoy[cycleInfo] = Ax_Vitesse.VitesseMoy(tempDataFilted, ref VitMax, 0.008); // Calc de la vitesse moyenne tabVitMax[cycleInfo] = VitMax; tabJerkM[cycleInfo] = Ax_Vitesse.JerkMet(tempDataFilted, VitMax, 0.008); // Calc du Jerk tabResultDist[cycleInfo] = Ax_Position.Distance(tempDataFilted); // Calc de la distance réelle tabDoub[0] = tabResultDist[cycleInfo]; double ampStrain = 0.0; double coordYMax = 0.0; if (exoEvalList[0].TypeEval == ExerciceEvalTypes.Mouvement) { ExerciceMouvement ef1 = (ExerciceMouvement)exoEvalList[0]; if (ef1.TypeDroite == DroiteType.VerticalLong) //FreeAmplitude { ampStrain = FreeAmplitude.CalAmpliFree(tempDataFilted, ref coordYMax); // special aller/retour :p tabCoordYMax[cycleInfo] = coordYMax; tabStra[cycleInfo] = Ax_Position.Straightness(ampStrain, tabDoub); // Calc de la Straightness } else if (ef1.TypeDroite == DroiteType.Vertical) { ampStrain = Target.CalAmpli(tempDataFilted); // Calc de l'amplitude tabStra[cycleInfo] = Ax_Position.Straightness(ampStrain, tabDoub); // Calc de la Straightness tabPresi[cycleInfo] = Target.PresciTarget(tempDataFilted); // calc precision target droite } } else if (exoEvalList[0].TypeEval == ExerciceEvalTypes.Forme) { ExerciceForme ef = (ExerciceForme)exoEvalList[0]; if (ef.TypeForme == FormeType.Cercle) { DataPosition centre = new DataPosition(XCENTRE, YCENTRE); // 37.0 46.0 double Rayon = 4.0; tabPresi[cycleInfo] = Circle.PreciCercle(tempDataFilted, centre, Rayon); } else { DataPosition centre = new DataPosition(XCENTRE, YCENTRE); double longCot = 6.0, Orientation = 0.0; tabPresi[cycleInfo] = Square.PreciCarre(tempDataFilted, centre, longCot, Orientation); } } tabSpeedMet[cycleInfo] = tabVitMoy[cycleInfo] / tabVitMax[cycleInfo]; // Calc de la Speed Metrique cycleInfo++; }
public void Distance_Entre_Deux_Points_Negative()//point 1 au-dessus du point 2 { double distance = Math.Sqrt(Math.Pow(listePoint[0].X - listePoint[1].X, 2) + Math.Pow(listePoint[0].Y - listePoint[1].Y, 2)); Assert.AreEqual(distance, Ax_Position.Distance(listePoint)); }