| Newsgroups |
gmane.text.xml.svg.devel |
| Message-ID |
<20151201132948.ba7b2c8bcece7cff40f52fc4f864ff8a.8003a07055.wbe@email07.europe.secureserver.net> |
<head>
<style type="text/css">
<!--
/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}
div.photo-title
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;
}
div.attach-table div.attach-row {
clear: both;
}
div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}
p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}
div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}
div.attach-table div.attach-row div div span {
font-weight: normal;
}
div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<html><body>
<!-- |**|begin egp html banner|**| -->
<br><br>
<!-- |**|end egp html banner|**| -->
<span style="font-family:Verdana; color:#000000; font-size:10pt;"><div style="color: rgb(0, 0, 0); font-family: verdana, geneva; font-size: 10pt;" mce_style="color: #000000; font-family: verdana, geneva; font-size: 10pt;">It would have been cruel if they hadn't given us an API for the path element!</div><div style="color: rgb(0, 0, 0); font-family: verdana, geneva; font-size: 10pt;" mce_style="color: #000000; font-family: verdana, geneva; font-size: 10pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: verdana, geneva; font-size: 10pt;" mce_style="color: #000000; font-family: verdana, geneva; font-size: 10pt;">The calculation of a polygon length:</div><div style="color: rgb(0, 0, 0); font-family: verdana, geneva; font-size: 10pt;" mce_style="color: #000000; font-family: verdana, g
eneva; font-size: 10pt;"><br></div><div><font face="verdana, geneva">// Distance between two points</font></div><div><font face="verdana, geneva"> </font>function getP2Pdistance (a, b) {</div><div><font face="verdana, geneva"> return Math.sqrt(Math.pow((b.x - a.x), 2) + Math.pow((b.y - a.y), 2));</font></div><div><font face="verdana, geneva"></font></div><div><font face="verdana, geneva"> }</font></div><div style=""><font face="verdana, geneva" style=""><br></font></div><div style=""><font face="verdana, geneva" style=""><br></font></div><div><font face="verdana, geneva"><span> function </span><span>perimeter (points) {</span></font></div><div><font face="verdana, geneva"><span> var p = 0;</span></font></div><div><font face="verd
ana, geneva"><span><br></span></font></div><div><font face="verdana, geneva"><span> for (var i = 1; i < points.length; i++) {</span></font></div><div><font face="verdana, geneva"><span> p += getP2Pdistance(points[i - 1], points[i]);</span></font></div><div><font face="verdana, geneva"><span> }</span></font></div><div><font face="verdana, geneva"><span> return p += getP2Pdistance(points[i - 1], points[0]);</span></font></div><div style=""><font face="verdana, geneva" style=""><span style=""> }</span></font></div><div><br></div><div>points is an array of point objects with x and y properties. Note: it wouldn't be smart to insert a test for the last segment, better add it manually.</div><div><br></div><div>Again, for self-i
ntersecting polygons, if one needs the external perimeter and not the total length, then one needs an intersection library, or at least one would be better off with to help work out which are the needed points.</div><div><br></div><div>Domenico</div><div><br></div><div><br></div>
<blockquote id="replyBlockquote" webmail="1" style="color: black; font-family: verdana; font-size: 10pt; border-left-width: 2px; border-left-style: solid; border-left-color: blue; margin-left: 8px; padding-left: 8px;" mce_style="color: black; font-family: verdana; font-size: 10pt; border-left-width: 2px; border-left-style: solid; border-left-color: blue; margin-left: 8px; padding-left: 8px;">
<div id="wmQuoteWrapper">
-------- Original Message --------<br>
Subject: [svg-developers] Re: [SVG] [Batik] Polygon Area<br>
From: "<a href="mailto:[email protected]">[email protected]</a> [svg-developers]"<br>
<<a href="mailto:[email protected]">[email protected]</a>><br>
Date: Tue, December 01, 2015 5:10 pm<br>
To: <a href="mailto:[email protected]">[email protected]</a><br>
<br>
<span style="display:none" mce_style="display:none"> </span> <div id="ygrp-mlmsg" style="position:relative;" mce_style="position:relative;"> <div id="ygrp-msg" style="z-index: 1;" mce_style="z-index: 1;"> <div id="ygrp-text"> <div>Thanks <span style="color:rgb(63, 63, 63);" mce_style="color:#3f3f3f;">Domenico,</span></div><div><span style="color:rgb(63, 63, 63);" mce_style="color:#3f3f3f;"><br></span></div><div><font color="#3f3f3f">How about checking the length of Polygon element ?</font></div><div><font color="#3f3f3f"><br></font></div><div><font color="#3f3f3f">I am using Java Batik and it is having element type 'SVGOMPolygonElement'.</font></div><div><font color="#3f3f3f">If you see SVGOMPathElement, it is having GetTotalLength API.</font></div><div><font color="#3f3f
3f"><br></font></div><div><font color="#3f3f3f">Surprisingly, there is no such API for SVGOMPolygonElement.</font></div><div><font color="#3f3f3f"><br></font></div><div><font color="#3f3f3f">I will wait for your valuable answer</font></div><div><font color="#3f3f3f"><br></font></div><div><font color="#3f3f3f">Thanks again</font></div><div><font color="#3f3f3f">Singh</font></div><div><font color="#3f3f3f"><br></font></div><div><br></div> </div> <div style="color: #fff; height: 0;"></div> <mce:style type="text/css"><!--
#wmQuoteWrapper #ygrp-mkp { border: 1px solid #d8d8d8; font-family: Arial; margin: 10px 0; padding: 0 10px; }
#wmQuoteWrapper #ygrp-mkp hr { border: 1px solid #d8d8d8; }
#wmQuoteWrapper #ygrp-mkp #hd { color: #628c2a; font-size: 85%; font-weight: 700; line-height: 122%; margin: 10px 0; }
#wmQuoteWrapper #ygrp-mkp #ads { margin-bottom: 10px; }
#wmQuoteWrapper #ygrp-mkp .ad { padding: 0 0; }
#wmQuoteWrapper #ygrp-mkp .ad p { margin: 0; }
#wmQuoteWrapper #ygrp-mkp .ad a { color: #0000ff; text-decoration: none; }
#wmQuoteWrapper #ygrp-sponsor #ygrp-lc { font-family: Arial; }
#wmQuoteWrapper #ygrp-sponsor #ygrp-lc #hd { margin: 10px 0px; font-weight: 700; font-size: 78%; line-height: 122%; }
#wmQuoteWrapper #ygrp-sponsor #ygrp-lc .ad { margin-bottom: 10px; padding: 0 0; }
#wmQuoteWrapper #actions { font-family: Verdana; font-size: 11px; padding: 10px 0; }
#wmQuoteWrapper #activity { background-color: #e0ecee; float: left; font-family: Verdana; font-size: 10px; padding: 10px; }
#wmQuoteWrapper #activity span { font-weight: 700; }
#wmQuoteWrapper #activity span:first-child { text-transform: uppercase; }
#wmQuoteWrapper #activity span a { color: #5085b6; text-decoration: none; }
#wmQuoteWrapper #activity span span { color: #ff7900; }
#wmQuoteWrapper #activity span .underline { text-decoration: underline; }
#wmQuoteWrapper .attach { clear: both; display: table; font-family: Arial; font-size: 12px; padding: 10px 0; width: 400px; }
#wmQuoteWrapper .attach div a { text-decoration: none; }
#wmQuoteWrapper .attach img { border: none; padding-right: 5px; }
#wmQuoteWrapper .attach label { display: block; margin-bottom: 5px; }
#wmQuoteWrapper .attach label a { text-decoration: none; }
#wmQuoteWrapper blockquote { margin: 0 0 0 4px; }
#wmQuoteWrapper .bold { font-family: Arial; font-size: 13px; font-weight: 700; }
#wmQuoteWrapper .bold a { text-decoration: none; }
#wmQuoteWrapper dd.last p a { font-family: Verdana; font-weight: 700; }
#wmQuoteWrapper dd.last p span { margin-right: 10px; font-family: Verdana; font-weight: 700; }
#wmQuoteWrapper dd.last p span.yshortcuts { margin-right: 0; }
#wmQuoteWrapper div.attach-table div div a { text-decoration: none; }
#wmQuoteWrapper div.attach-table { width: 400px; }
#wmQuoteWrapper div.file-title a, #wmQuoteWrapper div.file-title a:active, #wmQuoteWrapper div.file-title a:hover, #wmQuoteWrapper div.file-title a:visited { text-decoration: none; }
#wmQuoteWrapper div.photo-title a, #wmQuoteWrapper div.photo-title a:active, #wmQuoteWrapper div.photo-title a:hover, #wmQuoteWrapper div.photo-title a:visited { text-decoration: none; }
#wmQuoteWrapper div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts { font-family: Verdana; font-size: 10px; font-weight: normal; }
#wmQuoteWrapper .green { color: #628c2a; }
#wmQuoteWrapper .MsoNormal { margin: 0 0 0 0; }
#wmQuoteWrapper o { font-size: 0; }
#wmQuoteWrapper #photos div { float: left; width: 72px; }
#wmQuoteWrapper #photos div div { border: 1px solid #666666; height: 62px; overflow: hidden; width: 62px; }
#wmQuoteWrapper #photos div label { color: #666666; font-size: 10px; overflow: hidden; text-align: center; white-space: nowrap; width: 64px; }
#wmQuoteWrapper #reco-category { font-size: 77%; }
#wmQuoteWrapper #reco-desc { font-size: 77%; }
#wmQuoteWrapper .replbq { margin: 4px; }
#wmQuoteWrapper #ygrp-actbar div a:first-child { /* border-right: 0px solid #000;*/ margin-right: 2px; padding-right: 5px; }
#wmQuoteWrapper #ygrp-mlmsg { font-size: 13px; font-family: Arial, helvetica,clean, sans-serif; *font-size: small; *font: x-small; }
#wmQuoteWrapper #ygrp-mlmsg table { font-size: inherit; font: 100%; }
#wmQuoteWrapper #ygrp-mlmsg select, #wmQuoteWrapper input, #wmQuoteWrapper textarea { font: 99% Arial, Helvetica, clean, sans-serif; }
#wmQuoteWrapper #ygrp-mlmsg pre, #wmQuoteWrapper code { font:115% monospace; *font-size:100%; }
#wmQuoteWrapper #ygrp-mlmsg * { line-height: 1.22em; }
#wmQuoteWrapper #ygrp-mlmsg #logo { padding-bottom: 10px; }
#wmQuoteWrapper #ygrp-msg p a { font-family: Verdana; }
#wmQuoteWrapper #ygrp-msg p#attach-count span { color: #1E66AE; font-weight: 700; }
#wmQuoteWrapper #ygrp-reco #reco-head { color: #ff7900; font-weight: 700; }
#wmQuoteWrapper #ygrp-reco { margin-bottom: 20px; padding: 0px; }
#wmQuoteWrapper #ygrp-sponsor #ov li a { font-size: 130%; text-decoration: none; }
#wmQuoteWrapper #ygrp-sponsor #ov li { font-size: 77%; list-style-type: square; padding: 6px 0; }
#wmQuoteWrapper #ygrp-sponsor #ov ul { margin: 0; padding: 0 0 0 8px; }
#wmQuoteWrapper #ygrp-text { font-family: Georgia; }
#wmQuoteWrapper #ygrp-text p { margin: 0 0 1em 0; }
#wmQuoteWrapper #ygrp-text tt { font-size: 120%; }
#wmQuoteWrapper #ygrp-vital ul li:last-child { border-right: none !important; }
--></mce:style><style type="text/css" mce_bogus="1"> #wmQuoteWrapper #ygrp-mkp { border: 1px solid #d8d8d8; font-family: Arial; margin: 10px 0; padding: 0 10px; }
#wmQuoteWrapper #ygrp-mkp hr { border: 1px solid #d8d8d8; }
#wmQuoteWrapper #ygrp-mkp #hd { color: #628c2a; font-size: 85%; font-weight: 700; line-height: 122%; margin: 10px 0; }
#wmQuoteWrapper #ygrp-mkp #ads { margin-bottom: 10px; }
#wmQuoteWrapper #ygrp-mkp .ad { padding: 0 0; }
#wmQuoteWrapper #ygrp-mkp .ad p { margin: 0; }
#wmQuoteWrapper #ygrp-mkp .ad a { color: #0000ff; text-decoration: none; }
#wmQuoteWrapper #ygrp-sponsor #ygrp-lc { font-family: Arial; }
#wmQuoteWrapper #ygrp-sponsor #ygrp-lc #hd { margin: 10px 0px; font-weight: 700; font-size: 78%; line-height: 122%; }
#wmQuoteWrapper #ygrp-sponsor #ygrp-lc .ad { margin-bottom: 10px; padding: 0 0; }
#wmQuoteWrapper #actions { font-family: Verdana; font-size: 11px; padding: 10px 0; }
#wmQuoteWrapper #activity { background-color: #e0ecee; float: left; font-family: Verdana; font-size: 10px; padding: 10px; }
#wmQuoteWrapper #activity span { font-weight: 700; }
#wmQuoteWrapper #activity span:first-child { text-transform: uppercase; }
#wmQuoteWrapper #activity span a { color: #5085b6; text-decoration: none; }
#wmQuoteWrapper #activity span span { color: #ff7900; }
#wmQuoteWrapper #activity span .underline { text-decoration: underline; }
#wmQuoteWrapper .attach { clear: both; display: table; font-family: Arial; font-size: 12px; padding: 10px 0; width: 400px; }
#wmQuoteWrapper .attach div a { text-decoration: none; }
#wmQuoteWrapper .attach img { border: none; padding-right: 5px; }
#wmQuoteWrapper .attach label { display: block; margin-bottom: 5px; }
#wmQuoteWrapper .attach label a { text-decoration: none; }
#wmQuoteWrapper blockquote { margin: 0 0 0 4px; }
#wmQuoteWrapper .bold { font-family: Arial; font-size: 13px; font-weight: 700; }
#wmQuoteWrapper .bold a { text-decoration: none; }
#wmQuoteWrapper dd.last p a { font-family: Verdana; font-weight: 700; }
#wmQuoteWrapper dd.last p span { margin-right: 10px; font-family: Verdana; font-weight: 700; }
#wmQuoteWrapper dd.last p span.yshortcuts { margin-right: 0; }
#wmQuoteWrapper div.attach-table div div a { text-decoration: none; }
#wmQuoteWrapper div.attach-table { width: 400px; }
#wmQuoteWrapper div.file-title a, #wmQuoteWrapper div.file-title a:active, #wmQuoteWrapper div.file-title a:hover, #wmQuoteWrapper div.file-title a:visited { text-decoration: none; }
#wmQuoteWrapper div.photo-title a, #wmQuoteWrapper div.photo-title a:active, #wmQuoteWrapper div.photo-title a:hover, #wmQuoteWrapper div.photo-title a:visited { text-decoration: none; }
#wmQuoteWrapper div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts { font-family: Verdana; font-size: 10px; font-weight: normal; }
#wmQuoteWrapper .green { color: #628c2a; }
#wmQuoteWrapper .MsoNormal { margin: 0 0 0 0; }
#wmQuoteWrapper o { font-size: 0; }
#wmQuoteWrapper #photos div { float: left; width: 72px; }
#wmQuoteWrapper #photos div div { border: 1px solid #666666; height: 62px; overflow: hidden; width: 62px; }
#wmQuoteWrapper #photos div label { color: #666666; font-size: 10px; overflow: hidden; text-align: center; white-space: nowrap; width: 64px; }
#wmQuoteWrapper #reco-category { font-size: 77%; }
#wmQuoteWrapper #reco-desc { font-size: 77%; }
#wmQuoteWrapper .replbq { margin: 4px; }
#wmQuoteWrapper #ygrp-actbar div a:first-child { /* border-right: 0px solid #000;*/ margin-right: 2px; padding-right: 5px; }
#wmQuoteWrapper #ygrp-mlmsg { font-size: 13px; font-family: Arial, helvetica,clean, sans-serif; *font-size: small; *font: x-small; }
#wmQuoteWrapper #ygrp-mlmsg table { font-size: inherit; font: 100%; }
#wmQuoteWrapper #ygrp-mlmsg select, #wmQuoteWrapper input, #wmQuoteWrapper textarea { font: 99% Arial, Helvetica, clean, sans-serif; }
#wmQuoteWrapper #ygrp-mlmsg pre, #wmQuoteWrapper code { font:115% monospace; *font-size:100%; }
#wmQuoteWrapper #ygrp-mlmsg * { line-height: 1.22em; }
#wmQuoteWrapper #ygrp-mlmsg #logo { padding-bottom: 10px; }
#wmQuoteWrapper #ygrp-msg p a { font-family: Verdana; }
#wmQuoteWrapper #ygrp-msg p#attach-count span { color: #1E66AE; font-weight: 700; }
#wmQuoteWrapper #ygrp-reco #reco-head { color: #ff7900; font-weight: 700; }
#wmQuoteWrapper #ygrp-reco { margin-bottom: 20px; padding: 0px; }
#wmQuoteWrapper #ygrp-sponsor #ov li a { font-size: 130%; text-decoration: none; }
#wmQuoteWrapper #ygrp-sponsor #ov li { font-size: 77%; list-style-type: square; padding: 6px 0; }
#wmQuoteWrapper #ygrp-sponsor #ov ul { margin: 0; padding: 0 0 0 8px; }
#wmQuoteWrapper #ygrp-text { font-family: Georgia; }
#wmQuoteWrapper #ygrp-text p { margin: 0 0 1em 0; }
#wmQuoteWrapper #ygrp-text tt { font-size: 120%; }
#wmQuoteWrapper #ygrp-vital ul li:last-child { border-right: none !important; }</style>
</div>
</blockquote></span>
<!-- |**|begin egp html banner|**| -->
<br>
<br>
<!-- |**|end egp html banner|**| -->
<div width="1" style="color: white; clear: both;"/>__._,_.___</div>
<div id="fromDMARC" style="clear:both; margin-top: 10px;">
<hr style="height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E3E3;">
Posted by: <[email protected]> <hr style="height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E3E3;">
</div>
<!-- Start Recommendations -->
<!-- End Recommendations -->
<!-- |**|begin egp html banner|**| -->
<br><br>
<tt>
-----<BR>
To unsubscribe send a message to: [email protected]<BR>
-or-<BR>
visit <a href="http://groups.yahoo.com/group/svg-developers">http://groups.yahoo.com/group/svg-developers</a> and click "edit my membership"<BR>
----</tt>
<br><br>
<!-- |**|end egp html banner|**| -->
<!-- |**|begin egp html banner|**| -->
<img src="http://geo.yahoo.com/serv?s=97476590/grpId=1298421/grpspId=1706030390/msgId=66501/stime=1449001793" width="1" height="1"> <br>
<!-- |**|end egp html banner|**| -->
<!-- |**|begin egp html banner|**| -->
<br>
<!-- |**|begin egp html banner|**| -->
<div id="ygrp-vital" style="background-color: #f2f2f2; font-family: Verdana; font-size: 10px; margin-bottom: 10px; padding: 10px;">
<span id="vithd" style="font-weight: bold; color: #333; text-transform: uppercase; "><a href="https://groups.yahoo.com/neo/groups/svg-developers/info;_ylc=X3oDMTJlMHVzODE4BF9TAzk3MzU5NzE0BGdycElkAzEyOTg0MjEEZ3Jwc3BJZAMxNzA2MDMwMzkwBHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTQ0OTAwMTc5Mg--" style="text-decoration: none;">Visit Your Group</a></span>
<ul style="list-style-type: none; margin: 0; padding: 0; display: inline;">
<li style="border-right: 1px solid #000; font-weight: 700; display: inline; padding: 0 5px; margin-left: 0;">
<span class="cat"><a href="https://groups.yahoo.com/neo/groups/svg-developers/members/all;_ylc=X3oDMTJmOW5jaGViBF9TAzk3MzU5NzE0BGdycElkAzEyOTg0MjEEZ3Jwc3BJZAMxNzA2MDMwMzkwBHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzE0NDkwMDE3OTI-" style="text-decoration: none;">New Members</a></span>
<span class="ct" style="color: #ff7900;">1</span>
</li>
</ul>
</div>
<div id="ft" style="font-family: Arial; font-size: 11px; margin-top: 5px; padding: 0 2px 0 0; clear: both;">
<a href="https://groups.yahoo.com/neo;_ylc=X3oDMTJkbmJyYTc3BF9TAzk3NDc2NTkwBGdycElkAzEyOTg0MjEEZ3Jwc3BJZAMxNzA2MDMwMzkwBHNlYwNmdHIEc2xrA2dmcARzdGltZQMxNDQ5MDAxNzkz" style="float: left;"><img src="http://l.yimg.com/ru/static/images/yg/img/email/new_logo/logo-groups-137x15.png" height="15" width="137" alt="Yahoo! Groups" style="border: 0;"/></a>
<div style="color: #747575; float: right;"> • <a href="https://info.yahoo.com/privacy/us/yahoo/groups/details.html" style="text-decoration: none;">Privacy</a> • <a href="mailto:[email protected]?subject=Unsubscribe" style="text-decoration: none;">Unsubscribe</a> • <a href="https://info.yahoo.com/legal/us/yahoo/utos/terms/" style="text-decoration: none;">Terms of Use</a> </div>
</div>
<!-- |**|end egp html banner|**| -->
</div> <!-- ygrp-msg -->
<br>
<!-- |**|end egp html banner|**| -->
<div style="color: white; clear: both;"/>__,_._,___</div>
</body></html>