Neycho:
There is no need to go to matrix multiplication, you only need to translate
One point, say the origin of the grid, all the other points will be in a
rectangular array and can be calculated in base to dx and dy of the original
grid, as the rotation transform is an isometric one(preserve distances). In
other words:
Let X0,Y0 the origin of the rotated grid, X',Y' the rotated Origin of the
grid, then
theta= rotation angle, maybe negative in this case
X' = X*cos(theta) + Y*sin(theta)
Y' = -Xsin(theta) + Y*cos(theta)
X'n = X' + n*dx
Y'n= Y' + n*dy
so now you have to transform the test point using the same method of X',Y',
and check if is inside the ij rectangle a= dx;b= dy , that's easy:
Let Xt,Yt the test point, dx,dy the x and y steps of the grid
Function IsInside(X' as double, Y' as double, dx as double, dy as double, Xt
as double, Yt as double) as boolean
dim i as integer
dim j as integer
dim Xinside as boolean
dim YInside as boolean
IsInside=false
Xinside=false
Yinside=false
'Avoid to nest for cicles
'Check if Xt is in some vertical strip
'You can obtain i and j in the same way
for j=0 to 499
if ((X' + (j-1)*dx) < Xt and Xt < (X' + j*dx) ) then
Xinside=true
exit for
end for
next j
'Check if Yt is in some horizontal strip
for i= 0 to 499
if (Y' + (i-1)*dy) < Yt) and (Yt < (Y' + i*dy))then
IsInside=true
exit for
end if
next i
IsInside=Xinside and Yinside
End function
wrote in message news:5845121@discussion.autodesk.com...
10x to you all, but you all don't get my point. This grid, that I'm speaking
about is not in model space. It is in a VBA array. I'm looking for a
mathematical way for finding that zone.