Agregar archivos de proyecto.
This commit is contained in:
73
JansenLegViewer/Cálculos.cs
Normal file
73
JansenLegViewer/Cálculos.cs
Normal file
@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static JansenLegSimulator.Rod;
|
||||
|
||||
namespace JansenLegSimulator
|
||||
{
|
||||
public partial class Cálculos
|
||||
{
|
||||
private void DefineSystem()
|
||||
{
|
||||
// Definir las barra motriz
|
||||
M = new Rod(new Vector2(a, l)) { Length = m, RodName = "M" };
|
||||
|
||||
// Definir las barras semi-independientes
|
||||
// Aquellas que tienen un extremo fijado a una coordenada
|
||||
B = new Rod(new Vector2(0, 0)) { Length = b, RodName = "B" };
|
||||
C = new Rod(new Vector2(0, 0)) { Length = c, RodName = "C" };
|
||||
D = new Rod(new Vector2(0, 0)) { Length = d, RodName = "D" };
|
||||
|
||||
// Definir y conectar los inicios de las barras flotantes
|
||||
// Aquellas cuyos dos extremos están conectados a otra barra
|
||||
J = new Rod() { Length = j, RodName = "J" }; J.ConnectBegin(ref M);
|
||||
K = new Rod() { Length = k, RodName = "K" }; K.ConnectBegin(ref M);
|
||||
E = new Rod() { Length = e, RodName = "E" }; E.ConnectBegin(ref B);
|
||||
|
||||
G = new Rod() { Length = g, RodName = "G" }; G.ConnectBegin(ref C);
|
||||
F = new Rod() { Length = f, RodName = "F" }; F.ConnectBegin(ref D);
|
||||
|
||||
H = new Rod() { Length = h, RodName = "H" }; H.ConnectBegin(ref G);
|
||||
I = new Rod() { Length = i, RodName = "I" }; I.ConnectBegin(ref C);
|
||||
|
||||
// Añadir las barras definidas a la lista
|
||||
// de elementos móviles.
|
||||
Elements.Add(M);
|
||||
Elements.Add(J);
|
||||
Elements.Add(B);
|
||||
|
||||
Elements.Add(C);
|
||||
Elements.Add(K);
|
||||
|
||||
Elements.Add(E);
|
||||
Elements.Add(D);
|
||||
|
||||
Elements.Add(G);
|
||||
Elements.Add(F);
|
||||
|
||||
Elements.Add(H);
|
||||
Elements.Add(I);
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
public void CalculateSystem()
|
||||
{
|
||||
// Para cada par de barras calcular y asignar los
|
||||
// ángulos de rotación necesarios para unirlas
|
||||
|
||||
// Articulación JB
|
||||
(J.Alpha, B.Alpha) = GetIntersectionAlphas(J, B);
|
||||
// Articulación CK
|
||||
(C.Alpha, K.Alpha) = GetIntersectionAlphas(C, K);
|
||||
// Articulación ED
|
||||
(E.Alpha, D.Alpha) = GetIntersectionAlphas(E, D);
|
||||
// Articulación FG
|
||||
(F.Alpha, G.Alpha) = GetIntersectionAlphas(F, G);
|
||||
// Articulación HI
|
||||
(H.Alpha, I.Alpha) = GetIntersectionAlphas(H, I);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user