[Python] Why is my code rendering curves rotated 90 degrees?

Discussão em 'Python' iniciado por Stack, Fevereiro 1, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to make a heating cable layout for floor heating and i got stuck with this problem.

    This i what i got from my code
    [​IMG]

    So i made a small program asking for width,lenght of the room and calculating the are in m2. And i need a graphical representation of how cable should be on the floor. This is my code for arch:

    # Add C-shaped curves at the end of each section


    for i in range(int(width // spacing)):
    theta = np.linspace(0, np.pi, 100)
    x_curve = length + (spacing / 2) * np.cos(theta)
    y_curve = (i + 1) * spacing + (spacing / 2) * np.sin(theta)
    color = 'blue' if total_length < 5 else 'red'
    ax.plot(x_curve, y_curve, color=color)
    total_length += np.pi * (spacing / 2)


    I'm a beginner so i tried what i knew so far. If someone can guide me or help me in anyway possible.

    Continue reading...

Compartilhe esta Página