Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gra #12538

Closed
EmanuelEduardo15 opened this issue Jan 23, 2025 · 1 comment
Closed

Gra #12538

EmanuelEduardo15 opened this issue Jan 23, 2025 · 1 comment
Labels
awaiting triage Awaiting triage from a maintainer

Comments

@EmanuelEduardo15
Copy link

What would you like to share?

import numpy as np
import matplotlib.pyplot as plt

Configurações para o círculo tangente à reta

x_m, R = 0, 5 # Centro do círculo no eixo x, raio do círculo
theta = np.linspace(0, 2 * np.pi, 500) # Ângulo do círculo
x_circulo = x_m + R * np.cos(theta) # Coordenadas x do círculo
z_circulo = R * np.sin(theta) # Coordenadas z do círculo (em cima ou embaixo da reta)

Configurações para a reta tangente

x_start, x_end = -10, 10 # Extremos da reta
x_reta = np.linspace(x_start, x_end, 500)
z_reta = np.zeros_like(x_reta) # Reta no plano horizontal

Ponto de tangência

x_tangente = x_m
z_tangente = 0

Plotagem

fig, ax = plt.subplots(figsize=(8, 6))
ax.plot(x_reta, z_reta, label="Reta tangente", color="blue", linewidth=2)
ax.plot(x_circulo, z_circulo, label="Círculo tangente", color="red", linewidth=2)
ax.scatter([x_tangente], [z_tangente], color="green", label="Ponto de tangência", s=100)

Ajustes do gráfico

ax.set_aspect("equal")
ax.set_xlabel("Eixo X")
ax.set_ylabel("Eixo Z")
ax.set_title("Reta Tangente com Círculo")
ax.legend()
plt.grid()
plt.show()

Additional information

No response

@EmanuelEduardo15 EmanuelEduardo15 added the awaiting triage Awaiting triage from a maintainer label Jan 23, 2025
@EmanuelEduardo15
Copy link
Author

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting triage Awaiting triage from a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant