ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¸¨ÂI°ÝÃD....(§Ú¥Ø«e±q¥¼¨ì¹Lªº»â°ì)

[µo°Ý] ¸¨ÂI°ÝÃD....(§Ú¥Ø«e±q¥¼¨ì¹Lªº»â°ì)

¥»©«³Ì«á¥Ñ ui123 ©ó 2013-11-11 19:48 ½s¿è

¤µ¤Ñ§Ú¸ò¦P¨Æ2¤H¦b¦Y¶º®É¡A¦P¨Æ¸ò§Ú°Q½×¤F¤U­±ªº°ÝÃD:


---------------------------------------------------------------------------------------

§Ú¦P¨Æ»¡:¥DºÞ³Ìªñ¥X¤F­Ó¶WÃøÃDµ¹¦o¡AÃD¥Ø¦pªþ¥ó¡AµM«á´N¥á¤F«Ü¦hdata½Ð¦o¤ÀÃþ

                   ¤j·§1000µ§¥ª¥k(X,y¶bÂI......"§ó®£©Æªº¨Æ" ¬O¤£¤@©w¬O¾ã¼Æ¡AÁÙ¦³¤p¼ÆÂIªº)

¦o»¡¡A¦o«Ü²Â¡A¥u·|¤@µ§¤@µ§¹ï¦b­þ¤@­Ó°Ï°ì¡A´N³o¼Ë¤@ª½¹ï¤U¥h......µM«á§Ú¤]À°¦o¹ï¤F«Ü¤[

§Ú¥u·|¥¿¤è§Î°Ï°ìµM«á¥Îif ....¦ý³o¦ü¥G¦æ¤£³q~¤µ¤Ñ¥[¤F¤@ÂI¯Z«á²×©ó§¹¦¨¤F  ^^~¶}¤ß

---------------------------------------------------------------------------------------


¥Ø«e¤]¥u¯à³o¼Ë~

¦pªG¤j®a¹J¨ì¸ò§Ú¤@¼Ëªºª¬ªp·|«ç»ò¼Ë©O?

ªþ¥ó¦p¤U:
¸¨ÂI°ÝÃD.rar (9.35 KB)

A¡BC°Ïµ¹ªº®y¼ÐÂI¬°«Ê³¬½u¬q¡A¤ñ¸û®e©ö³B²z
B°Ï·Pı¤]¬O¥|Ãä§Î¦n¹³¦bA¡BC°Ï¤U¤è¡A®y¼ÐÂI¤£¬O«Ê³¬½u¬q»Ý­n¸ÉÂI©ÎÃB¥~³B²z
B°Ïªº´y­z¥i§_¥t¦æ¸ÉÂI(®y¼Ð)³B²z

­ì«h¤W¥|Ãä«Ê³¬°Ï°ì¥i¥H¥Î¤¤¤ß»PÀˬdÂI³s¤@ª½½u¡AÀˬd»P¥|Ãä½u¬O§_¬Û¥æ¡A¥þ³¡¨S¦³¬Û¥æ´N¬O¦b¸Ì­±¡A»P¥ô¤@½u¬Û¥æªí¥Ü¦b¥~­±¡C

µ¥§Ú©ú¤Ñ¦^¨Ó¦A¸Ô²Ó¬ã¨s
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 1# ui123
B°Ï¸É§¹(6,6),(5,5)§Î¦¨¥W¦hÃä§Î
§PÂ_ªººtºâªk¥i¥H°Ñ¦Ò http://www.csie.ntnu.edu.tw/~u91029/Polygon.html
¸Ì­± §PÂ_¤@­ÓÂI¬O§_¦b²³æ¦hÃä§Î¤º³¡¸Ì­± ³o¤@¬q

TOP

¦^´_ 3# stillfish00
stillfish00 ¤j  ~¦³¬Ý¨ì§Aªþªººô¯¸¡AÁÂÁÂ!  ¦n¦h©_©_©Ç©Çªº¹Ï~(@[]@!!)
¦pªG³o­Ó¨Ò¤l(ªþ¥ó¤¤¦bM¡ANÄ檺®y¼Ð)­n¥ÎVBA¼g¦¨¬O¤£¬O·|«D±`«D±`ªº½ÆÂø?
§Ú¬Ý¥Lªº¨ç¼Æ¬Ý°_¨Ó¤£¬OVBAªº¨ç¼Æ¼g¦¨ªº?  «D±`­¯¥Í¡A VBAªº¨ç¼Æ¦³³o¨Ç¥\¯à?!
¸¨ÂI°ÝÃD_§PÂ_¨Ò¤l.rar (10.27 KB)

TOP

¦^´_ 2# ML089
ML089¤j~
B°Ïªº´y­z¥i§_¥t¦æ¸ÉÂI(®y¼Ð)³B²z?   ¥i¥Hªº¡A³o¼Ë¤]¤ñ¸û¦X²z¡A¥BABC°ÏµL¥æ¶°
¤]´N¬O»¡¡A¦pªG­è¦n¦b­«Å|ªº½u¤W¡A¨ú¸û¤p¨º¤@­Ó(A<B<C)¡A¨Ò¦p¡A­è¦n¦bA°Ï¤ÎB°Ï¥æ±µ½u¤W¡AºâA°Ïªº
¤U­±¦³¥tªþ¨Ò¤l¡Astillfish00 ¤j»¡ªº¦nÃø¡A³oºØ°ÝÃD¥Î"VBA¨ç¼Æ"¥i¥H¼gªº¥X¨Ó¶Ü?!
ºô¸ô¤W§Ú§ä¤£¨ìVBA¼gªº¨Ò¤l~
¥u¬O§Ú¤]«Ü¦n©_VBA¬O§_¯à¸Ñ¨M¦¹Ãþ°ÝÃD¡A³oºØ°ÝÃD·Pı«Ü²³æ¡A¦ý¦ü¥G¶WÃø§PÂ_ªº!~
¤j®a¥i¥H·Q¤@·Q¡AÁÂÁÂ!

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-11-13 00:27 ½s¿è

¦^´_ 4# ui123
¥L¬OC/C++¼gªº¡A§ï¦¨VBA¤j¬ù¦p¤U
  1. Function pointInPoly(ptx As Double, pty As Double, arPoly) As Boolean
  2.     Dim i As Long, j As Long
  3.     Dim pix As Double, piy As Double
  4.     Dim pjx As Double, pjy As Double
  5.    
  6.     For i = 1 To UBound(arPoly) - 1
  7.         j = i + 1
  8.         pix = arPoly(i, 1): piy = arPoly(i, 2)
  9.         pjx = arPoly(j, 1): pjy = arPoly(j, 2)
  10.         
  11.         '¤£¥]§tÂI¦b¦hÃä§Î½u¤W
  12.         If Not (piy > pty) = (pjy > pty) Then
  13.             If ptx < (pjx - pix) * (pty - piy) / (pjy - piy) + pix Then pointInPoly = Not pointInPoly
  14.         End If
  15.     Next
  16. End Function
½Æ»s¥N½X
§Q¥Î¥L¼g¤@­Ó¦Û­q¨ç¼ÆRegionABC
  1. Function RegionABC(x As Double, y As Double, RegionA As Range, RegionB As Range, RegionC As Range) As String
  2.     '¤£¥]§tÂI¦bABCÃä½t
  3.     If pointInPoly(x, y, RegionA.Value) Then RegionABC = "A": Exit Function
  4.     If pointInPoly(x, y, RegionB.Value) Then RegionABC = "B": Exit Function
  5.     If pointInPoly(x, y, RegionC.Value) Then RegionABC = "C": Exit Function
  6.     RegionABC = "¤£¦bABC"
  7. End Function
½Æ»s¥N½X
¥ý¸É»ôB°ÏªºÂI¡A
¨Ï¥Î¡A¨Ò¦p¦bO4¤½¦¡¥´¤W  "=RegionABC(M4,N4,$C$4:$D$8,$C$10:$D$16,$C$18:$D$22)"

TOP

¦^´_ 3# stillfish00


  stillfish00¤j´£¨Ñªº¸ê®Æ«Ü§¹¾ã¡AÁÂÁ§A´£¨Ñ¨º»ò§¹¾ãªººô­¶¸ê°T¡C
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 6# stillfish00


    ¹ªÀy¤@¤U¡AC»y¨¥§ï¬°VBA¡A­è¦n¥i¥H°Ñ¦Ò¡AÁÂÁÂ
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 5# ui123

stillfish00 ¤jªº¥\¤O°ª±j¡A¨Ï¥Î¦Û­q¨ç¼ÆÀ³¸Ó³Ì¦nªº¤è¦¡

ºô­¶¤¤©Ò­zªº¤èªk¤ñ§ÚÁ¿ªº¦Ò¼{¤èªkÁÙ­n¥¿½T

§PÂ_¤@­ÓÂI¬O§_¦b²³æ¦hÃä§Î¤º³¡
±qµ¹©wÂI¶}©l¡A©¹ÀH«K¤@­Ó¤è¦V¡]¹ê§@®É²ßºD¤ô¥­©¹¥k¡^®g¥X¤@±øµL­­ªø®g½u¡A¬Ý¬Ý¬ï¹L¦h¤Ö±øÃä¡C¦pªG¬ï¹L°¸¼Æ¦¸¡Aªí¥ÜÂI¦b²³æ¦hÃä§Î¥~³¡¡F¦pªG¬ï¹L©_¼Æ¦¸¡Aªí¥ÜÂI¦b²³æ¦hÃä§Î¤º³¡¡C
­n¤p¤ß³B²z®g½u¬ï¹L³»ÂI¡B®g½u»PÃä­«Å|ªº±¡ªp¡C¤]­n¤p¤ß³B²zÂI¦b¦hÃä§ÎÃä¬É¤Wªº±¡ªp¡C
®É¶¡½ÆÂø«×¬° O(N) ¡A N ¬°Â²³æ¦hÃä§Îªº³»ÂI¼Æ¥Ø¡C

§Ú¦A¨Ó¬ã¨s¥i§_¥Î¤½¦¡¨M¸Ñ¡A¦ý·|¤ñVBA¬Ý°_¨Ó§ó½ÆÂø¡C
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 6# stillfish00

¤£¦n·N«ä¡A­É¸Óª©¸ê®Æ

stillfish00¤j:
¥i§_½Ð§A¦AÀ°¦£¼g A¡BB¡BCµ¥°Ï°ì­±¿nªº¦Û­q¨ç¼Æ¡A·P®¦¡C
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

        ÀR«ä¦Û¦b : ­n¤ñ½Ö§ó¨ü½Ö¡D¤£­n¤ñ½Ö§ó©È½Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD