Re: [R] Linear Integration

2010-10-07 Thread alaios
No, because I thought something that might be easier. If you see the image again you might notice that the proportions I am looking for might also be found by using the hypotenuse which is the same (as all squares are triangles) by finding the adjacent. The adjacent are easier to be found by

Re: [R] Linear Integration

2010-10-07 Thread Michael Bedward
Um... if that makes sense for the analysis that you're trying to do then that's great. I had assumed that you were using the term integral in its usual sense, ie. area under the curve. Michael On 7 October 2010 18:52, alaios ala...@yahoo.com wrote: No, because I thought something that might be

Re: [R] Linear Integration

2010-10-06 Thread alaios
I would like to thank you for your reply. Yes I had this conversation of how to find the cells that are touched. I did that with these two lines: temp-(floor(cbind(seq(x[1],xr[1],by=0.01),lineeq(x,xr #. cellid2 -unique( floor(cbind(seq(x[1],xr[1], by=0.01), lineeq(x,xr)) ) ) # cell ids

Re: [R] Linear Integration

2010-10-06 Thread Michael Bedward
Hi Alex, In the picture are depicted the areas that I need to calculate somehow. Of course the easiest way would be to use some already implemented function which does not seem to exist. That was why I posted a function to calculate polygon area in my previous reply :) Have you tried that

[R] Linear Integration

2010-10-05 Thread Alaios
Hello I would like to calculate a weighted line integral. The integral is calculated by the cells that this lines trasverses (the small cells belong to matrix (m*n) that represent the value that a specific area has. I need to calculate the weights by finding out how much the line touches or

Re: [R] Linear Integration

2010-10-05 Thread Michael Bedward
Hi Alex, I remember that you had the discussion recently about identifying grid cells that were crossed by a line... http://tolstoy.newcastle.edu.au/R/e11/help/10/09/8431.html So, following on from those posts, for any cell crossed by a line you will know the coordinates of the cell corners and