<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How many points are need to construct a smooth circular arc? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300439#M23250</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;follow up&amp;nbsp;&amp;nbsp; an arc between 0 and 5 degrees, center at 5,5, 50 points... using the np.linspace option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; ang=np.linspace(0, 5, num=50, endpoint=True, retstep=False)
&amp;gt;&amp;gt;&amp;gt; ang= np.deg2rad(ang)
&amp;gt;&amp;gt;&amp;gt; Xs = 1*np.cos(ang)
&amp;gt;&amp;gt;&amp;gt; Ys = 1*np.sin(ang)
&amp;gt;&amp;gt;&amp;gt; pnts = np.array(list(zip(Xs,Ys)))
&amp;gt;&amp;gt;&amp;gt; pnts = np.round(pnts + [5,5], 3)
&amp;gt;&amp;gt;&amp;gt; pnts
array([[ 6.000,&amp;nbsp; 5.000],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 6.000,&amp;nbsp; 5.002],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.997,&amp;nbsp; 5.080],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.997,&amp;nbsp; 5.082],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.996,&amp;nbsp; 5.084],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.996,&amp;nbsp; 5.085],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.996,&amp;nbsp; 5.087]])&lt;/PRE&gt;&lt;P&gt;much finer resolution, over a 5 degree range.&amp;nbsp; Using this option you are pretty well limitless.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:24:48 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T14:24:48Z</dc:date>
    <item>
      <title>How many points are need to construct a smooth circular arc?</title>
      <link>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300435#M23246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all.&amp;nbsp; I need to construct circular arc by&amp;nbsp; array using Arcpy. Apparently the larger the circle, the more number of points in ArcMap. How many points are need to keep same smoothness with ArcMap platform, what's the relationship between diameter R and Number of points to get it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 23:05:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300435#M23246</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-08-03T23:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: How many points are need to construct a smooth circular arc?</title>
      <link>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300436#M23247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;three points are needed to constuct a circle.&amp;nbsp; Depending on what you are using, circles are often represented by n-gons (n-sided regular polygons) typically with 360 segments.&amp;nbsp; True circles? certainly not in shapefiles.&amp;nbsp; Arcs? not sure either.&amp;nbsp; Pure geometry would create the arc, circle, sector geometry using equations rather than representing them as polylines.&amp;nbsp; Points can be sampled along their length, but the intervening space between points are line segments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have an example of a featureclass (not graphics) in some incarnation that you are trying to create circular or elliptical components?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 23:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300436#M23247</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-08-03T23:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: How many points are need to construct a smooth circular arc?</title>
      <link>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300437#M23248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dan. below is code:&lt;/P&gt;&lt;P&gt;def circle_array(x,y,c1,c2,r):&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #x,y for center, c1,c2 for start and end angle, r for diameter&lt;/P&gt;&lt;P&gt; ar=[]&lt;/P&gt;&lt;P&gt; deg2rad=math.pi/180.0&lt;/P&gt;&lt;P&gt; n=360.0&lt;/P&gt;&lt;P&gt; for i in range(0,n+1):&lt;/P&gt;&lt;P&gt;&amp;nbsp; ang = (c1+(c2-c1)*i/n) * deg2rad&lt;/P&gt;&lt;P&gt;&amp;nbsp; arx=x + r * math.cos(ang)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ary=y + r * math.sin(ang)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; ar.append([arx,ary,0])&lt;/P&gt;&lt;P&gt; return ar &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just wonder how to decide the n to keep the same smoothness with arcmap platform&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 23:32:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300437#M23248</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-08-03T23:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: How many points are need to construct a smooth circular arc?</title>
      <link>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300438#M23249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;up for some numpy and python?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# -*- coding: UTF-8 -*-
"""
:Script:&amp;nbsp;&amp;nbsp; circle_make.py
&lt;SPAN&gt;:Author:&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Dan.Patterson@carleton.ca" rel="nofollow noopener noreferrer" target="_blank"&gt;Dan.Patterson@carleton.ca&lt;/A&gt;
:Modified: 2016-08-03
:Purpose: make a circle
"""
#---- imports, formats, constants ----
import sys
import numpy as np
from textwrap import dedent

ft={'bool':lambda x: repr(x.astype('int32')),
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'float': '{: 0.3f}'.format}
np.set_printoptions(edgeitems=10, linewidth=80, precision=2,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; suppress=True, threshold=100, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formatter=ft)
script = sys.argv[0]

#---- functions ----
def _demo(radius=100, theta=1, xc=0.0, yc=0.0):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; :Requires
&amp;nbsp;&amp;nbsp;&amp;nbsp; :--------
&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; radius - in projected units
&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; angle - integer
&amp;nbsp;&amp;nbsp;&amp;nbsp; :Returns
&amp;nbsp;&amp;nbsp;&amp;nbsp; :-------
&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; list of coordinates rounded to 3 decimal places
&amp;nbsp;&amp;nbsp;&amp;nbsp; :Notes:
&amp;nbsp;&amp;nbsp;&amp;nbsp; :------
&amp;nbsp;&amp;nbsp;&amp;nbsp; : If you need more than 360 points use, for example 720 points
&amp;nbsp;&amp;nbsp;&amp;nbsp; : np.linspace(start, stop, num=50, endpoint=True, retstep=False)
&amp;nbsp;&amp;nbsp;&amp;nbsp; : np.linspace(-180, 180, num=720, endpoint=True, retstep=False)
&amp;nbsp;&amp;nbsp;&amp;nbsp; """
&amp;nbsp;&amp;nbsp;&amp;nbsp; angle = [np.deg2rad(i) for i in range(-180,180,theta)]
&amp;nbsp;&amp;nbsp;&amp;nbsp; Xs = radius*np.cos(angle)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # X values
&amp;nbsp;&amp;nbsp;&amp;nbsp; Ys = radius*np.sin(angle)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Y values
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnts = np.array(list(zip(Xs,Ys)))
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnts = np.round(pnts + [xc,yc], 3)
&amp;nbsp;&amp;nbsp;&amp;nbsp; p_lst = pnts.tolist()
&amp;nbsp;&amp;nbsp;&amp;nbsp; return p_lst

#----------------------
if __name__=="__main__":
&amp;nbsp;&amp;nbsp;&amp;nbsp; """&amp;nbsp;&amp;nbsp; """
&amp;nbsp;&amp;nbsp;&amp;nbsp; #print("Script... {}".format(script))
&amp;nbsp;&amp;nbsp;&amp;nbsp; p_lst = _demo(radius=1, theta=30, xc=5, yc=5)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(p_lst)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if I return the pnts array instead of the list (p_lst) then the output for the demo with a center (5,5) radius 1 and angle of 30&lt;/P&gt;&lt;P&gt;array([[ 4.000,&amp;nbsp; 5.000],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 4.134,&amp;nbsp; 4.500],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 4.500,&amp;nbsp; 4.134],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.000,&amp;nbsp; 4.000],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.500,&amp;nbsp; 4.134],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.866,&amp;nbsp; 4.500],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 6.000,&amp;nbsp; 5.000],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.866,&amp;nbsp; 5.500],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.500,&amp;nbsp; 5.866],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.000,&amp;nbsp; 6.000],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 4.500,&amp;nbsp; 5.866],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 4.134,&amp;nbsp; 5.500]]))&lt;/P&gt;&lt;P&gt;in list form&lt;/P&gt;&lt;P&gt;[[4.0, 5.0], [4.134, 4.5], [4.5, 4.134], [5.0, 4.0], [5.5, 4.134], [5.866, 4.5], [6.0, 5.0], [5.866, 5.5], [5.5, 5.866], [5.0, 6.0], [4.5, 5.866], [4.134, 5.5]]&lt;/P&gt;&lt;P&gt;If you need more than 360 points, see the notes in the header section and generate the angles using np.linspace&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:24:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300438#M23249</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T14:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: How many points are need to construct a smooth circular arc?</title>
      <link>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300439#M23250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;follow up&amp;nbsp;&amp;nbsp; an arc between 0 and 5 degrees, center at 5,5, 50 points... using the np.linspace option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; ang=np.linspace(0, 5, num=50, endpoint=True, retstep=False)
&amp;gt;&amp;gt;&amp;gt; ang= np.deg2rad(ang)
&amp;gt;&amp;gt;&amp;gt; Xs = 1*np.cos(ang)
&amp;gt;&amp;gt;&amp;gt; Ys = 1*np.sin(ang)
&amp;gt;&amp;gt;&amp;gt; pnts = np.array(list(zip(Xs,Ys)))
&amp;gt;&amp;gt;&amp;gt; pnts = np.round(pnts + [5,5], 3)
&amp;gt;&amp;gt;&amp;gt; pnts
array([[ 6.000,&amp;nbsp; 5.000],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 6.000,&amp;nbsp; 5.002],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.997,&amp;nbsp; 5.080],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.997,&amp;nbsp; 5.082],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.996,&amp;nbsp; 5.084],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.996,&amp;nbsp; 5.085],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 5.996,&amp;nbsp; 5.087]])&lt;/PRE&gt;&lt;P&gt;much finer resolution, over a 5 degree range.&amp;nbsp; Using this option you are pretty well limitless.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-many-points-are-need-to-construct-a-smooth/m-p/300439#M23250</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T14:24:48Z</dc:date>
    </item>
  </channel>
</rss>

