I believe I addressed making s1 = s2 [that is, making the two direction's spacing equal] in my previous post. As for the angle of a polygon given vertices, that's too vague for me to know what you want, sorry.
Printable View
I believe I addressed making s1 = s2 [that is, making the two direction's spacing equal] in my previous post. As for the angle of a polygon given vertices, that's too vague for me to know what you want, sorry.
Thanks jemidiah; actually I usedlet us stick to square or here in my case rectangle, I used the same s,Code:off1 += s*v(1)*(d(3)/d(1)) & off2 += s*v(4)*(d(1)/d(4))
Regarding to the other question, if the only information given is the vertices of polygon, how can I calculate its angles???
For angles, first you'd need to make the polygon. If you know the vertices in clockwise order, given a convex polygon, it's easy: pick a vertex v, with a previous vertex p and a next vertex n. Compute a = v - p and b = v - n; the angle between a and b, which may be found easily using a dot product, is the angle you want.
If you don't know the vertices in clockwise order, you can find them using one of several convex hull algorithms.
THanks, yes I found the angle and then divide by \pi, as I need to know wheather the angles are rational or irrational multiple of \pi, I've got this number 0.397583618, how do I know WEATHER rational or irrational???
First divide the number by pi as you said. Then, determine if it's rational, which is entirely dependent upon your specific use. Your example gives 0.12655479619, which is also 12655479619/100000000000, a rational number. However, it's not a "pretty" rational, so you might call it irrational. You could check to see if it's one of several small rationals, say limiting yourself to a numerator and denominator of 3 digits each.
Sorry but your question is really vague, so I can only give a vague answer.
let me state the question clearly, I have the length of two sides 2.82842712, 4.47213595 I want the angle between them as a multiple of pi, so after calculating the angle and then divide by pi, I've got 0.397583618
now I wanna to know if 0.397583618 is rational or irrational, is there any role to distinguish between the two types?for the other angle I 've got 0.852416382 so the same rational or irrational???
appreciate ur time
You haven't made the problem any clearer to me, you've just added an extra example without extra explanation. The number 0.397583618 is rational in the sense that it can be expressed as the ratio of two integers; the same is true of 0.852416382. Perhaps you don't mean to use the word rational, but I'm at a loss to explain what you really want.
how can I integrate a function(f(x)) on polygonal area numerically on each point we had generated by the grids in the previous threads, we can start with double summation and multiply by dx, dy, but how can we end the summation? the double summation seems to be difficult to implemented as a code......
Evaluate f at each point on the grid; find the average of these results; multiply by the area of the polygonal area (which you can approximate by knowing how many points of this grid there are). Take the grid to be a very fine mesh, avoid overflow errors when finding the average, and you'll approximate the surface integral.
All of this requires that you can iterate over the points of the mesh, which shouldn't be difficult; you could make a linked list of vertex points as you make them.
Hi everyone
I have a small question, how can I generate nice illustrating figures like ones in thread 3, 19, and 49, I mean what is the tools or packages for that??
Many thanks
I made the image in #49 in MS Paint. I don't know what Nick uses (though his images are significantly nicer than mine).
I use Photoshop. It's really expensive if you just want it for freelance use, but there's free alternatives like Gimp that do the job very well too.