Created
November 17, 2010 21:13
-
-
Save fsouza/704095 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf-8 | |
"""Implementação do exercício de composição do livro Aprenda Computação com Python. | |
Enunciado disponível em: http://www.franciscosouza.com.br/aprendacompy/capitulo_05.html#composicao | |
""" | |
def coeficienteAngular(x1, y1, x2, y2): | |
return float(y2 - y1) / (x2 - x1) | |
def cortaY(x1, y1, x2, y2): | |
coeficiente = coeficienteAngular(x1, y1, x2, y2) | |
return coeficiente * x1 * -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment