(limit)
See Euclid's formula
    (https://en.wikipedia.org/wiki/Pythagorean_triple#Generating_a_triple)
    for more information
See Euclid's formula
    (https://en.wikipedia.org/wiki/Pythagorean_triple#Generating_a_triple)
    for more information
See Euclid s formula ( https : // en . wikipedia . org / wiki / Pythagorean_triple#Generating_a_triple ) for more information
def primitive_triplets(limit):
    """See Euclid's formula
    (https://en.wikipedia.org/wiki/Pythagorean_triple#Generating_a_triple)
    for more information
    """
    for member_1, member_2 in euclidian_coprimes(limit):
        calc_1 = member_1 ** 2
        calc_2 = member_2 ** 2

        alpha = calc_1 - calc_2
        beta = 2 * member_1 * member_2
        gamma = calc_1 + calc_2

        if alpha > beta:
            alpha, beta = beta, alpha

        yield alpha, beta, gamma
def primitive_triplets ( limit ) : for member_1 , member_2 in euclidian_coprimes ( limit ) : calc_1 = member_1 ** 2 calc_2 = member_2 ** 2 alpha = calc_1 - calc_2 beta = 2 * member_1 * member_2 gamma = calc_1 + calc_2 if alpha > beta : alpha , beta = beta , alpha yield alpha , beta , gamma