Search
Home
Saved
0
57 views
Sign In
Upload
Join
RELATED TITLES
0
Polígonos Regulares Programación Java
Uploaded by Fermonforte
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Polígonos regulares programación Java
Save
Embed
Share
Print
Download
Coordenadas polares
1
of 8
Unidad 3. Coordenadas
coordenadasw.pdf
Search document
Polígonos regulares programación Java
Inforscience Otro sitio de programación, algoritmos y GNU/Linux
http://rendon.x10.mx/?p=78 este es el enlace. Buscar en google “ método para calcular las
coordenadas de un polígono polígono””
Master your semester with Scribd & The New York Times Special offer for students: BuscarOnly $4.99/month.
Menú principal
Read Free Foron 30this Days Sign up to vote title
Not useful Cancel anytime.
Useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Upload
Sign In
Read Free For 30 Days Cancel anytime.
Join
Search
Home
Saved
0
57 views
Sign In
Upload
Join
RELATED TITLES
0
Polígonos Regulares Programación Java
Uploaded by Fermonforte
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Polígonos regulares programación Java
Save
Embed
Share
Print
Download
Coordenadas polares
1
of 8
Unidad 3. Coordenadas
coordenadasw.pdf
Search document
Hace algún tiempo tuve la necesidad de desarrollar una aplicación en Java que dibujara polígonos regulares y estrellas de n lados y n picos respectivamente para una materia en la escuela. En un principio me fue difícil solucionar este problema pero al final encontré la manera. A continuación comento en que consiste la solución. Es común que la mayoría de nosotros estemos familiarizados con el sistema de coordenadas rectangulares donde cada punto en el espacio se representa por dos valores de la forma ( x ,
y) donde x, y ∈ R , x corresponde al desplazamiento sobre la recta horizontal y y corresponde desplazamiento vertical. Véase figura 1.
You're Reading a Preview Unlock full access with a free trial.
Download With Free Trial Figura 1. Plano cartesiano y coordenadas rectangulares.
Con este sistema de coordenadas es posible representar cualquier objeto geométrico, Master your semester with Scribd Free For 30this Days Sign up to vote on title que nos incluyendo nuestros polígonos, sin embargo existen otrosRead sistemas de coordenadas & The New York Times Useful Not useful facilitan las cosas para esta tarea en especial, me refiero a las coordenadas polares: Special offer for students: Only $4.99/month.
Cancel anytime.
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Upload
Sign In
Read Free For 30 Days Cancel anytime.
Join
Search
Home
Saved
0
57 views
Sign In
Upload
Join
RELATED TITLES
0
Polígonos Regulares Programación Java
Uploaded by Fermonforte
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Polígonos regulares programación Java
Save
Embed
Share
Print
Download
Coordenadas polares
1
of 8
Unidad 3. Coordenadas
coordenadasw.pdf
Search document
Como se aprecia en la imagen el sistema consiste en una serie de círculos concéntricos con
radios de diferente longitud en el rango [0, ∞]. Cada punto en el espacio es representado por l dupla ( r , θ ) donde r es el radio de un círculo y θ el ángulo a partir de la recta horizontal en
sentido antihorario. Dependiendo de la unidad en que se midan los ángulos θ puede tomar los valores [−π , π ] o [0,2π ] si la unidad es el radián, o bien [0,360 ] si la unidad se mide en ∘
grados.
Una vez asimilados estos conceptos podemos formular la solución. Para un polígono de N lad y radio r (radio del círculo circunscrito al polígono) las coordenadas de las N esquinas son
12πN), (r , 22πN),…, (r , N2πN ). Para el caso de la estrella de N picos se trabaja de manera similar: Se construye un polígono regular de N lados y para cada par de puntos se agrega un
punto más a la mitad de estos dos con un radio menor a r y por último solo resta unir los punt con líneas rectas.
Hablemos un poco a cerca de la implementación. El lenguaje que empleo aquí es Java pero es puede fácilmente ser portado a cualquier otro lenguaje ya que la teoría es la misma. Veamos pues como está conformada el área de dibujo en Java:
You're Reading a Preview Unlock full access with a free trial.
Download With Free Trial
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Read Free Foron 30this Days Sign up to vote title
Not useful Cancel anytime.
Useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Upload
Sign In
Read Free For 30 Days Cancel anytime.
Join
Search
Home
Saved
0
57 views
Sign In
Upload
Join
RELATED TITLES
0
Polígonos Regulares Programación Java
Uploaded by Fermonforte
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Polígonos regulares programación Java
Save
Embed
Share
Print
Coordenadas polares
1
Download
of 8
Unidad 3. Coordenadas
coordenadasw.pdf
Search document
y′=maxY − y Donde maxY es la altura del área de dibujo. Para obtener el valor original de y a partir de y′ empleamos la siguiente operación:
y=maxY − y′ Ya casi tenemos todo listo para empezar a codificar, solo falta ver cómo convertir las coordenadas polares a rectangulares, pequeño detalle. De la siguiente ilustración se puede observar que tenemos los datos necesarios para obtener las componentes rectangulares de un punto.
You're Reading a Preview Unlock full access with a free trial.
Download With Free Trial
Figura 4. Componentes de un punto.
La componente horizontal es el cateto adyacente y por tanto x=r cos (θ ), el cateto opuesto es l componente vertical y de ahí que y=r sin (θ ). Ahora sí, al código. Veamos cómo quedaría el Master your semester with Scribd Free Foron 30this Days Sign up to vote title método para calcular las coordenadas de un polígono: Read & The New York Times Useful Not useful /** 1
*Only Compute the coordinates of a polygon. Special offer for students: $4.99/month. 2 3
* * @param n number of sides
Cancel anytime.
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Upload
Sign In
Read Free For 30 Days Cancel anytime.
Join
Search
Home
Saved
0
57 views
Sign In
Upload
Join
RELATED TITLES
0
Polígonos Regulares Programación Java
Uploaded by Fermonforte
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Polígonos regulares programación Java
Save
Embed
Share
Print
1
Download
17
of 8
Unidad 3. Coordenadas
coordenadasw.pdf
Search document
for (int i = 0; i < n; i++) { x = r * Math.cos(i * theta); y = r * Math.sin(i * theta);
18 19 20
// Rotate the polygon such that the mouse click matches the polygon corner xPrime = x * Math.cos(beta) - y * Math.sin(beta); yPrime = x * Math.sin(beta) + y * Math.cos(beta);
21 22 23
// Translate the polygon to it's original position xPrime += cx; yPrime += cy;
24 25 26
polygon.add(new Point((int)Math.round(xPrime), (int)Math.round(yPrime)));
27 28
Coordenadas polares
} }
29 30 31 32 33 34 35
En las líneas 25 a 27 se hace una rotación a la figura con el fin de que el primer vertice del You're Reading a Preview poligono coincida con el punto donde se encuentra el apuntador del ratón. Esta transformació
Unlock full access a free en realidad no forma parte del algoritmo sino máswith bien portrial. estética. Los métodos int ly(int
y) y int oy(int y) se encargan de obtener y′ y y respectivamente.
Download With Free Trial
private int ly(int y) { return maxY - y; } private int oy(int y) { return maxY - y; }
Master your with Scribd Como semester pueden observer los métodos son idénticos, sin embargo el objetivo es distinto. Por Read Free Foron 30this Days Sign up to vote title claridad los emplearemos código paraNot estrellas esel & The New York Times para sus respectivas funciones.ElUseful lasuseful siguiente: Special offer for students: Only $4.99/month.
Cancel anytime.
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Upload
Sign In
Read Free For 30 Days Cancel anytime.
Join
Search
Home
Saved
0
57 views
Sign In
Upload
Join
RELATED TITLES
0
Polígonos Regulares Programación Java
Uploaded by Fermonforte
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Polígonos regulares programación Java
Save
Embed
Share
Print
Coordenadas polares
1
Download
13
of 8
Unidad 3. Coordenadas
coordenadasw.pdf
Search document
beta = Math.atan2(py - cy, px - cx), x, y, xPrime, yPrime;
14 15
star.clear ();
16
for (int i = 0; i < n; i++) { x = r * Math.cos(i * theta); y = r * Math.sin(i * theta);
17 18 19
// Rotate the polygon such that the mouse click matches the star point xPrime = x * Math.cos(beta) - y * Math.sin(beta); yPrime = x * Math.sin(beta) + y * Math.cos(beta);
20 21 22 23
// Translate to it's o riginal position xPrime += cx; yPrime += cy; star.add(new Point((int)Math.round(xPrime), (int)Math.round(yPrime)));
24 25 26
x = 0.5 * r * Math.cos(i * theta + 0.5 * theta); y = 0.5 * r * Math.sin(i * theta + 0.5 * theta);
27 28 29
xPrime = x * Math.cos(beta) - y * Math.sin(beta); yPrime = x * Math.sin(beta) + y * Math.cos(beta);
30 31
xPrime += cx; yPrime += cy; star.add(new Point((int)Math.round(xPrime), (int)Math.round(yPrime)));
32 33
}
34 35
}
You're Reading a Preview
Unlock full access with a free trial.
36 37 38
Download With Free Trial
39 40
Master your semester with Scribd & The New York Times 41 42 43
Special offer for students: Only $4.99/month. 44 45
Read Free Foron 30this Days Sign up to vote title
Not useful Cancel anytime.
Useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Upload
Sign In
Read Free For 30 Days Cancel anytime.
Join
Search
Home
Saved
0
57 views
Sign In
Upload
Join
RELATED TITLES
0
Polígonos Regulares Programación Java
Uploaded by Fermonforte
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Polígonos regulares programación Java
Save
Embed
Share
Print
Download
Coordenadas polares
1
of 8
Unidad 3. Coordenadas
coordenadasw.pdf
Search document
You're Reading a Preview Unlock full access with a free trial.
Figura 5.El resultado.
Hasta aquí con este post, espero lesDownload sea de utilidad. He deTrial comentarles que este tema de los With Free gráficos por computadora es uno de mis temas favoritos ya que es aquí donde encuentro una
aplicación práctica e interesante a tanta teoría de mis cursos de matemáticas. Tengo planes de
Master your semester with Scribd hacer una serie de artículos a cerca de estos temas con más detalle yFor aplicaciónes. Read Free 30this Days Sign up to vote on title Hasta la proxima! & The New York Times Useful Not useful Special offer for students: Only $4.99/month.
Cancel anytime.
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Upload
Sign In
Read Free For 30 Days Cancel anytime.
Join
Search
Home
Saved
0
57 views
Sign In
Upload
Join
RELATED TITLES
0
Polígonos Regulares Programación Java
Uploaded by Fermonforte
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Polígonos regulares programación Java
Save
Embed
Share
Print
Download
Coordenadas polares
1
of 8
Unidad 3. Coordenadas
coordenadasw.pdf
Search document
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. Esta entrada fue publicada en Algoritmos, Escuela, Matemática, Programación y etiquetada cateto adyacente, cateto opuesto, codigo fuente, coordenadas cartesianas, coordenadas polares , cos, dibujar estrellas, poligonos regulares, sin, trigonometria por D.D.C. Guarda enlace permanente .
You're Reading a Preview Unlock full access with a free trial.
Download With Free Trial
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Read Free Foron 30this Days Sign up to vote title
Not useful Cancel anytime.
Useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Master your semester with Scribd & The New York Times Special offer for students: Only $4.99/month.
Upload
Sign In
Read Free For 30 Days Cancel anytime.
Join