search for: pythagora

Displaying 6 results from an estimated 6 matches for "pythagora".

Did you mean: pythagoras
2009 Nov 20
3
help me avoid nested for() loops!
...[,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) These represent pixel coordinates of interest in a jpeg image. I need to find the distance from each point to all other points of interest. The only way I can see to do this is by pythagoras and nested for loops. distance<-function(x1,y1,x2,y2){sqrt((x2-x1)^2 + (y2-y1)^2)} #pythagoras for(i in 1:nrow(points)){ for(j in 1:nrow(points)){ dist<-c(dist,distance(points[i,1],point.array.indices[i,2],points[j,1],points[j,2])) } } This is obviously prohibitively slow with >10000...
2011 Feb 16
2
distance between consecutive points
Dear R users, I have two coloumns of data, say x and y, referring to a list of points in 2D space. I am trying to develop a code that will give me the distances (using Pythagoras) between consecutive points (xi,yi) and (xi+1,yi+1). So far I have come up with the following: for (i in 1:length(x)) d<-sqrt((x[i+1]-x[i])^2+(y[i+1]-y[i])^2) For example, if I use the two points (note, I have hundreds of points for x,y) x<-c(64.59,64.60) y<-c(-179.28,-179.28) d should...
2011 Mar 08
4
minimum distance between line segments
...s to work out the distance between midpoints (it quickly became apparent that this is totally wrong when looking at the plot). So, I thought that perhaps finding the minimum distance between each of the lines endpoints AND their midpoints would be a good proxy for this, so I set up a loop that uses pythagoras to work out these 9 distances and find the minimum. But, this solution is obviously flawed as well (sometimes lines actually intersect, sometimes the minimum distances are less etc). Any help/dection on this one would be much appreciated. Thanks in advance, Darcy.
2005 Aug 18
4
Driver for Powerware 3105 (USB)
I ordered some Powerware 3105 devices for Linux workstations. These devices only have an USB interface. I understood too late that support for Powerware devices is only available for the serial interface. Since the protocols over serial and USB seem to be identical, it was not too difficult to modify the bcmxcp driver to support USB. The new and changed files can be found here:
2005 Oct 09
3
bcmxcp - Powerware 9125
I'm currently testing the bcmxcp driver for NUT, and it causes me some trouble. And when scanning the archives it seems like the 3110 USB problem reported recently. The bcmxcp daemon stops running, and the logs shows the following: Oct 6 14:22:32 host.dom.tld bcmxcp[82628]: Communications with UPS lost: Receive error (data): got -1 bytes instead of 28!!! Oct 6 14:22:33 host.dom.tld
2010 Mar 29
18
please decrypt your manuals
I. most of ssh manual and all sshd manual present server and client as one machine, called host. All files mentioned are placed on one machine. This is incorrect, and makes the explanation unclear. For example, man sshd SSH_KNOWN_HOSTS FILE FORMAT suggests to copy keys from /etc/ssh/ssh_host_key.pub into /etc/ssh/ssh_known_hosts, as if those files are on the same machine. II. a general