Unexpected behavior of the procedure `Area` on the object 'Polygon'How to ContourPlot a Table?Unexpected behavior of Unevaluatedis there a way to construct a pattern that would trigger when an expression is used as a held/unevaluated in some form?How to copy text from InputField without adding spurious spaces?many indefinite integrals do not evaluate in 10.1, looking for the causeWhat is the difference between GenerateDocument and TemplateApply[NotebookTemplate[Comparing exact expressions for equality — is it really OK if I get wrong answer?Simple arithmetic with Irrationals failsFinding area of intersection regionsWhy Area give the wrong results when the region cannot be formed?
Pre-mixing cryogenic fuels and using only one fuel tank
Question about the proof of Second Isomorphism Theorem
What should you do if you miss a job interview (deliberately)?
Request info on 12/48v PSU
Aragorn's "guise" in the Orthanc Stone
How can we generalize the fact of finite dimensional vector space to an infinte dimensional case?
What are the purposes of autoencoders?
Drawing ramified coverings with tikz
Lowest total scrabble score
Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?
Do Legal Documents Require Signing In Standard Pen Colors?
why `nmap 192.168.1.97` returns less services than `nmap 127.0.0.1`?
Yosemite Fire Rings - What to Expect?
How to implement a feedback to keep the DC gain at zero for this conceptual passive filter?
250 Floor Tower
Melting point of aspirin, contradicting sources
Is it possible to put a rectangle as background in the author section?
Is there a name for this algorithm to calculate the concentration of a mixture of two solutions containing the same solute?
Should I outline or discovery write my stories?
How can "mimic phobia" be cured or prevented?
What is the evidence for the "tyranny of the majority problem" in a direct democracy context?
Why is it that I can sometimes guess the next note?
Removing files under particular conditions (number of files, file age)
Are the IPv6 address space and IPv4 address space completely disjoint?
Unexpected behavior of the procedure `Area` on the object 'Polygon'
How to ContourPlot a Table?Unexpected behavior of Unevaluatedis there a way to construct a pattern that would trigger when an expression is used as a held/unevaluated in some form?How to copy text from InputField without adding spurious spaces?many indefinite integrals do not evaluate in 10.1, looking for the causeWhat is the difference between GenerateDocument and TemplateApply[NotebookTemplate[Comparing exact expressions for equality — is it really OK if I get wrong answer?Simple arithmetic with Irrationals failsFinding area of intersection regionsWhy Area give the wrong results when the region cannot be formed?
$begingroup$
Sometimes get a results, sometimes left unevaluated.
For instance
Area@Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
12
Transpose@(a.b.Transpose[#]) & /@ Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
(a,b - some 2x2 matrices)
Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]
Area@(Transpose@(a.b.Transpose[#]) & /@ Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4] )
Area[Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]]
Area@Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]
(copy and paste)
1440
How to guess when a calculation will give a result and when it will not be evaluated? And why does it not evaluate?
bugs evaluation computational-geometry polygons packed-arrays
$endgroup$
add a comment |
$begingroup$
Sometimes get a results, sometimes left unevaluated.
For instance
Area@Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
12
Transpose@(a.b.Transpose[#]) & /@ Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
(a,b - some 2x2 matrices)
Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]
Area@(Transpose@(a.b.Transpose[#]) & /@ Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4] )
Area[Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]]
Area@Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]
(copy and paste)
1440
How to guess when a calculation will give a result and when it will not be evaluated? And why does it not evaluate?
bugs evaluation computational-geometry polygons packed-arrays
$endgroup$
3
$begingroup$
What are the definitions ofa
andb
?
$endgroup$
– MarcoB
yesterday
$begingroup$
If you want to experiment with this and I haven't made a mistake then it looks like hisa.b == 2,7,-16,4
This seems to reproduce his results.
$endgroup$
– Bill
yesterday
add a comment |
$begingroup$
Sometimes get a results, sometimes left unevaluated.
For instance
Area@Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
12
Transpose@(a.b.Transpose[#]) & /@ Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
(a,b - some 2x2 matrices)
Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]
Area@(Transpose@(a.b.Transpose[#]) & /@ Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4] )
Area[Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]]
Area@Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]
(copy and paste)
1440
How to guess when a calculation will give a result and when it will not be evaluated? And why does it not evaluate?
bugs evaluation computational-geometry polygons packed-arrays
$endgroup$
Sometimes get a results, sometimes left unevaluated.
For instance
Area@Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
12
Transpose@(a.b.Transpose[#]) & /@ Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
(a,b - some 2x2 matrices)
Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]
Area@(Transpose@(a.b.Transpose[#]) & /@ Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4] )
Area[Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]]
Area@Polygon[0, 0, 8, -64, 18, -24, 36, -48, 28, 16]
(copy and paste)
1440
How to guess when a calculation will give a result and when it will not be evaluated? And why does it not evaluate?
bugs evaluation computational-geometry polygons packed-arrays
bugs evaluation computational-geometry polygons packed-arrays
edited yesterday
kirma
10.2k13058
10.2k13058
asked yesterday
Slepecky MamutSlepecky Mamut
620110
620110
3
$begingroup$
What are the definitions ofa
andb
?
$endgroup$
– MarcoB
yesterday
$begingroup$
If you want to experiment with this and I haven't made a mistake then it looks like hisa.b == 2,7,-16,4
This seems to reproduce his results.
$endgroup$
– Bill
yesterday
add a comment |
3
$begingroup$
What are the definitions ofa
andb
?
$endgroup$
– MarcoB
yesterday
$begingroup$
If you want to experiment with this and I haven't made a mistake then it looks like hisa.b == 2,7,-16,4
This seems to reproduce his results.
$endgroup$
– Bill
yesterday
3
3
$begingroup$
What are the definitions of
a
and b
?$endgroup$
– MarcoB
yesterday
$begingroup$
What are the definitions of
a
and b
?$endgroup$
– MarcoB
yesterday
$begingroup$
If you want to experiment with this and I haven't made a mistake then it looks like his
a.b == 2,7,-16,4
This seems to reproduce his results.$endgroup$
– Bill
yesterday
$begingroup$
If you want to experiment with this and I haven't made a mistake then it looks like his
a.b == 2,7,-16,4
This seems to reproduce his results.$endgroup$
– Bill
yesterday
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
EDIT: Reported to WRI as CASE:4237867 - and apparently should work on V12. :)
Seems like a bug in my opinion. Consider the following:
With[poly0 = Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4],
With[poly = Transpose[IdentityMatrix[2].Transpose@#] & /@ poly0,
poly0 === poly, Area /@ poly0, poly]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
Although the Mma considers poly0
and its transformed but identical copy (coordinates transformed using IdentityMatrix
) identical, they produce different results.
Probably the internal representation of poly
is not the same as poly0
. At the same time its output form is identical, which actually transforms it to other form if you copy and paste it.
This can be further simplified to show that from the perspective of Polygon
two semantically identical coordinate lists can differ:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Area@*Polygon /@ coord0, coord]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
I suspect there's something wrong with the way Polygon
reads the internal representation of a list!
EDIT: I think there's a good chance this problem is caused by the fact coord
is a packed array, while coord0
is not:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Developer`PackedArrayQ /@ coord0, coord,
Area@*Polygon /@ coord0, Developer`FromPackedArray@coord]]
True, False, True, 12, 12
So, you can use FromPackedArray
on the transformed coordinate list as a workaround.
$endgroup$
add a comment |
$begingroup$
This is a packed array issue:
Area @ Polygon[Developer`ToPackedArray @ 0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
This will be fixed in M12.
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193772%2funexpected-behavior-of-the-procedure-area-on-the-object-polygon%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
EDIT: Reported to WRI as CASE:4237867 - and apparently should work on V12. :)
Seems like a bug in my opinion. Consider the following:
With[poly0 = Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4],
With[poly = Transpose[IdentityMatrix[2].Transpose@#] & /@ poly0,
poly0 === poly, Area /@ poly0, poly]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
Although the Mma considers poly0
and its transformed but identical copy (coordinates transformed using IdentityMatrix
) identical, they produce different results.
Probably the internal representation of poly
is not the same as poly0
. At the same time its output form is identical, which actually transforms it to other form if you copy and paste it.
This can be further simplified to show that from the perspective of Polygon
two semantically identical coordinate lists can differ:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Area@*Polygon /@ coord0, coord]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
I suspect there's something wrong with the way Polygon
reads the internal representation of a list!
EDIT: I think there's a good chance this problem is caused by the fact coord
is a packed array, while coord0
is not:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Developer`PackedArrayQ /@ coord0, coord,
Area@*Polygon /@ coord0, Developer`FromPackedArray@coord]]
True, False, True, 12, 12
So, you can use FromPackedArray
on the transformed coordinate list as a workaround.
$endgroup$
add a comment |
$begingroup$
EDIT: Reported to WRI as CASE:4237867 - and apparently should work on V12. :)
Seems like a bug in my opinion. Consider the following:
With[poly0 = Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4],
With[poly = Transpose[IdentityMatrix[2].Transpose@#] & /@ poly0,
poly0 === poly, Area /@ poly0, poly]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
Although the Mma considers poly0
and its transformed but identical copy (coordinates transformed using IdentityMatrix
) identical, they produce different results.
Probably the internal representation of poly
is not the same as poly0
. At the same time its output form is identical, which actually transforms it to other form if you copy and paste it.
This can be further simplified to show that from the perspective of Polygon
two semantically identical coordinate lists can differ:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Area@*Polygon /@ coord0, coord]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
I suspect there's something wrong with the way Polygon
reads the internal representation of a list!
EDIT: I think there's a good chance this problem is caused by the fact coord
is a packed array, while coord0
is not:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Developer`PackedArrayQ /@ coord0, coord,
Area@*Polygon /@ coord0, Developer`FromPackedArray@coord]]
True, False, True, 12, 12
So, you can use FromPackedArray
on the transformed coordinate list as a workaround.
$endgroup$
add a comment |
$begingroup$
EDIT: Reported to WRI as CASE:4237867 - and apparently should work on V12. :)
Seems like a bug in my opinion. Consider the following:
With[poly0 = Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4],
With[poly = Transpose[IdentityMatrix[2].Transpose@#] & /@ poly0,
poly0 === poly, Area /@ poly0, poly]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
Although the Mma considers poly0
and its transformed but identical copy (coordinates transformed using IdentityMatrix
) identical, they produce different results.
Probably the internal representation of poly
is not the same as poly0
. At the same time its output form is identical, which actually transforms it to other form if you copy and paste it.
This can be further simplified to show that from the perspective of Polygon
two semantically identical coordinate lists can differ:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Area@*Polygon /@ coord0, coord]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
I suspect there's something wrong with the way Polygon
reads the internal representation of a list!
EDIT: I think there's a good chance this problem is caused by the fact coord
is a packed array, while coord0
is not:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Developer`PackedArrayQ /@ coord0, coord,
Area@*Polygon /@ coord0, Developer`FromPackedArray@coord]]
True, False, True, 12, 12
So, you can use FromPackedArray
on the transformed coordinate list as a workaround.
$endgroup$
EDIT: Reported to WRI as CASE:4237867 - and apparently should work on V12. :)
Seems like a bug in my opinion. Consider the following:
With[poly0 = Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4],
With[poly = Transpose[IdentityMatrix[2].Transpose@#] & /@ poly0,
poly0 === poly, Area /@ poly0, poly]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
Although the Mma considers poly0
and its transformed but identical copy (coordinates transformed using IdentityMatrix
) identical, they produce different results.
Probably the internal representation of poly
is not the same as poly0
. At the same time its output form is identical, which actually transforms it to other form if you copy and paste it.
This can be further simplified to show that from the perspective of Polygon
two semantically identical coordinate lists can differ:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Area@*Polygon /@ coord0, coord]]
True, 12, Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
I suspect there's something wrong with the way Polygon
reads the internal representation of a list!
EDIT: I think there's a good chance this problem is caused by the fact coord
is a packed array, while coord0
is not:
With[coord0 = 0, 0, 4, 0, 2, 2, 4, 4, 0, 4,
With[coord = Transpose[IdentityMatrix[2].Transpose@coord0],
coord0 === coord, Developer`PackedArrayQ /@ coord0, coord,
Area@*Polygon /@ coord0, Developer`FromPackedArray@coord]]
True, False, True, 12, 12
So, you can use FromPackedArray
on the transformed coordinate list as a workaround.
edited yesterday
answered yesterday
kirmakirma
10.2k13058
10.2k13058
add a comment |
add a comment |
$begingroup$
This is a packed array issue:
Area @ Polygon[Developer`ToPackedArray @ 0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
This will be fixed in M12.
$endgroup$
add a comment |
$begingroup$
This is a packed array issue:
Area @ Polygon[Developer`ToPackedArray @ 0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
This will be fixed in M12.
$endgroup$
add a comment |
$begingroup$
This is a packed array issue:
Area @ Polygon[Developer`ToPackedArray @ 0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
This will be fixed in M12.
$endgroup$
This is a packed array issue:
Area @ Polygon[Developer`ToPackedArray @ 0, 0, 4, 0, 2, 2, 4, 4, 0, 4]
Area[Polygon[0, 0, 4, 0, 2, 2, 4, 4, 0, 4]]
This will be fixed in M12.
answered yesterday
Carl WollCarl Woll
71.4k394186
71.4k394186
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193772%2funexpected-behavior-of-the-procedure-area-on-the-object-polygon%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
$begingroup$
What are the definitions of
a
andb
?$endgroup$
– MarcoB
yesterday
$begingroup$
If you want to experiment with this and I haven't made a mistake then it looks like his
a.b == 2,7,-16,4
This seems to reproduce his results.$endgroup$
– Bill
yesterday