La Pirámide
Author: Luis Alfonso Rojas
Date: 21 Mayo 2013

A continuación se presenta una pirámide cuya base es un polígono regular.

Número de lados

Radio de la base

Altura de la pirámide

Rotación vertical

Rotación horizontal

Arrastre el cursor para visualizar las distinas pirámides

α = 0.3490658503988659 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
β = 4.537856055185257 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
n = 3 (slider from 3 to 15, step 1)
i = Vector((sin(β), -cos(β) * sin(α)))
j = Vector((cos(β), sin(β) * sin(α)))
k = Vector((0, cos(α)))
altura = 2.7 (slider from 0.5 to 3.5, step 0.1)
radio = 2.6 (slider from 1 to 5, step 0.1)
xbase = Sequence(radio * cos(-(π / n) + 2 * π * i / n), i, 1, n)
ybase = Sequence(radio * sin(-(π / n) + 2 * π * i / n), i, 1, n)
listabaseinf = Sequence(Vector[Element[xbase, s] * i + Element[ybase, s] * j], s, 1, n)
verticesbaseinf = Sequence(Point[(0, 0), Vector[Element[listabaseinf, s]]], s, 1, n)
polígono1 = Polygon(verticesbaseinf)
V = Point((0, altura * y(k)), k)
caras: {Sequence[Polygon[Element[verticesbaseinf, i], Element[verticesbaseinf, i + 1], V], i, 1, n - 1], Polygon[Element[verticesbaseinf, n], Element[verticesbaseinf, 1], V]}
l = Segment(Point[(0, 0), Vector[Element[listabaseinf, 1]]], Point[(0, 0), Vector[Element[listabaseinf, 2]]])
A = Midpoint(l)
a_b = Segment((0, 0), A)
a_p = Segment(A, V)
h = Segment((0, 0), V)
r = Segment(Point[(0, 0), Vector[Element[listabaseinf, 1]]], (0, 0))
a_r = Segment(Point[(0, 0), Vector[Element[listabaseinf, 1]]], V)
polígono2, v, a, b = Polygon(Point[(0, 0), Vector[Element[listabaseinf, 1]]], (0, 0), V)
polígono3, v_1, a_1, c = Polygon(A, (0, 0), V)
O = (0, 0)
d = Circle(O, 0.2)
B = Intersect(d, h, 1)
e = Line(B, a_b)
f = Line(B, r)
C = Intersect(d, r, 1)
D = Intersect(d, a_b, 1)
g = Line(C, h)
m = Line(B, a_b)
p = Line(D, h)
E = Intersect(f, g)
t = Segment(B, E)
b_1 = Segment(E, C)
F = Intersect(e, p)
q = Segment(B, F)
s = Segment(F, D)