Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Ingeniería de Software
NRC: 8015
Puntas.
B) Geometría de la Figura
Calculamos los valores de los segmentos ‘b’ y ‘c’ en el triángulo rectángulo AJW:
AW b
cos (36 °)= =
AJ L
(1)
b=cos (36 °)⋅ L
c=sin(36 °) ⋅ L (2)
Calculamos los valores de los segmentos ‘a’ y ‘d’ en el triángulo rectángulo IJX:
IJ =L ; JX =a ; IX=d
IX d
cos (18 °)= =
IJ L
d=cos ( 18 ° ) ⋅ L
(3)
a=sin (18°)⋅ L (4)
A(x A , y A )= A (a+b ; 0)
B ( x B , y B )=B ( a+ b+ L; 0 )
C ( x C , y C )=C ( a+2 b+ L; c )
D ( x D , y D )=D ( 2 a+2 b+ L ; c +d )
F ( x F , y F ) =F ( a+ b+ L ; 2 c+2 d )
G ( x G , y G )=G ( a+b ; 2 c +2 d )
H ( x H , y H )=H ( a ; c +2 d )
I ( x I , y I )=I ( 0 ; c+ d )
J ( x J , y J )=J ( a; c )
( L
O ( xO , y O ) =O a+ b+ ; c +d
2 )
Con los puntos obtenidos se pueden graficar con líneas las siguientes figuras
geométricas: a) Un decágono regular grande ABCDEFGHIJ, de color negro (Black); b)
un polígono estrellado de 10 puntas ABCDEFGHIJ, de color azul oscuro (DarkBlue).
P ( x P , y P ) =P
( y 3− y 1 +m1 ⋅ x 1−m2 ⋅ x 3
m1−m2 )
; y 1 +m1 ( x P−x 1 ) ;m1−m2 ≠0
Con este Teorema se pueden calcular los puntos de intersección entre las diferentes
rectas que conforman al decágono regular grande para calcular los puntos de la estrella
de 10 puntas, de esta manera:
C) Algoritmos
1.
1.1
1.2
1.3
D) Código de la Aplicación
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
namespace WinAppTenPointGemPoligon
{
class CTenPointGemPoligon
{
// Datos Miembro (Atributos).
a = side * (float)Math.Sin(angle2);
b = side * (float)Math.Cos(angle1);
c = side * (float)Math.Sin(angle1);
d = side * (float)Math.Cos(angle2);
A.X = a + b; A.Y = 0;
B.X = a + b + side; B.Y = 0;
C.X = a + 2 * b + side; C.Y = c;
D.X = 2 * a + 2 * b + side; D.Y = c + d;
E.X = a + 2 * b + side; E.Y = c + 2 * d;
F.X = a + b + side; F.Y = 2 * c + 2 * d;
G.X = a + b; G.Y = 2 * c + 2 * d;
H.X = a; H.Y = c + 2 * d;
I.X = 0; I.Y = c + d;
J.X = a; J.Y = c;
if ((m1 - m2) != 0)
{
P.X = (P3.Y - P1.Y + m1 * P1.X - m2 * P3.X) /
(m1 - m2);
P.Y = P1.Y + m1 * (P.X - P1.X);
}
return (P);
}
CalculateVertexDecagon();
CalculateVertexTenPointedRegularStar();
CalculateVertexTenPointedInteriorStar();
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinAppTenPointGemPoligon
{
public partial class frmTenPointGemPoligon : Form
{
// Definición de un objeto de tipo CTenPointGemPoligon.
CTenPointGemPoligon ObjTenPointedStarPolygon = new
CTenPointGemPoligon();
public frmTenPointGemPoligon()
{
InitializeComponent();
}
ObjTenPointedStarPolygon.PlotFigures(picCanvas);
}
E) Pruebas de la Aplicación