The pythagorean tag has no wiki summary.
0
votes
0answers
2 views
Timing and Position Triangulation Using Sensors
Say I have 3 vibration sensors around in a room. How would I determine the location of someone in the room using these vibration sensors. If I used an fpga I'm sure it could sample fast enough to ...
0
votes
1answer
57 views
comparison of two same type of lines in a code
i have two equations here
m = (4*z - 1 + i)/2;
w = (2*z + i);
both equations use same type of variables but when value of p is greater than 14 m%n gives the correct value whereas w%n ...
10
votes
3answers
206 views
Having trouble understanding list comprehensions
I've just started learning haskell(literally, tonight!) and I'm having a little trouble understanding the logic of list comprehensions, more specifically the <- operator. A little example on Learn ...
0
votes
2answers
41 views
Working out the distance between 2 points in one plane only
How can I find the distance between the two points as shown in the above picture.
I know I can use Pythagoras to find the 'actual' distance between the two points, but I want to find the X distance ...
0
votes
2answers
101 views
Pythagorean triplets whose sum is 1000?
Project Euler problem 9. I tried to solve it, infact I get triplets which are not Pythagorean triplets and their sum is 1000, Why? I made sure they were Pythagorean triplets. Here is my long and not ...
2
votes
2answers
738 views
Calculate distance in (x,y) between two GPS-Points
I'm looking for a smoothie way to calculate the distance between two GPS-Points, so I get the result like: "You have to go x-meters up and y-meters to the left - so I can work with a 2d-coordinate ...
1
vote
2answers
110 views
Accelerate framework ios: Fastest pythagoren calculation
So I have 2 matrices: each is 100x100.
I am looking to calculate a 3rd matrix such that: M3[i]=sqrt(M1[i]^2 + M2[i]^2).
I can obviously do ForLoops but I am sure there is something faster.
I ...
0
votes
1answer
111 views
Finding all possible pythagorean triangles within a set of triangles
REVISION 1
I've looked at this thread: All possible Pythagorean Triples
Looks similar to mine but I can't get mine to work for some reason..
Here's my code:
#include <iostream>
#include ...
-3
votes
1answer
187 views
Why isn't this Python pythagorean theorem solver working? [closed]
print "Welcome to Dylan's Pythagorean Theorem Solver."
from math import sqrt
print "What are we solving for? A hypotenuse or a leg?"
ask = raw_input("# ")
if ask == "hypotenuse":
print "What ...
1
vote
1answer
76 views
Parametrization of primitive Pythagorean triples
I have already wrote an algorithm to find integer Pythagorean triples, but unfortunately the algorithm runs at O(n^3). Does anyone know how to use parametrization to find Pythagorean triples? If so, ...
0
votes
1answer
177 views
algorithm for finding primitive pythagorean triples
here is my code:
// PPT.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#define LOWER_BOUND 1
#define ...
0
votes
0answers
139 views
Which one is better haversine or pythagorean?
I have mysql query to calculate distance between given longitudes and latitude within 50 meter radius. Here I want to know that by performance, speed and distance accuracy wise which one is better, ...
0
votes
0answers
115 views
Evenly distribute n points between two fixed points
I have two fixed points, (x1,y1) and (x2,y2).
I am trying to distribute n points between them, so that the distance between every point is equal.
This is easy when they are in a straight line, but I ...
1
vote
1answer
301 views
Prolog: pythagorean triple
I have this code that uses an upper bound variable N that is supposed to terminate for X and Y of the pythagorean triple. However it only freezes when it reaches the upper bound. Wasn't sure how to ...
0
votes
5answers
114 views
function return: PHP
I'm not sure what I'm missing, but I can't get $c to output correctly.
<?php
function pythThm($a, $b){
$a2 = pow($a, 2);
$b2 = pow($b, 2);
$c = sqrt($a2 + $b2);
...