Could I name a number in tikz?












1














I have been drawing some pictures using tikz, and am wondering if I can name a number.



For example, I pick a point $A$ with position angle $alpha=45degree$ on a circle, and a line going through that point with direction angle $beta=alpha+90degree=135degree$ (with is perpendicular to the position vector).



Later I change the point $A$ to be $alpha=60degree$, and then $beta=150 degree$.



Now I change both angles manually. If I can name the first angle $alpha$ and the second angle $beta$, then I only need to change $alpha$: $beta$ will vary accordingly.



Is there a way to do this, naming a number? Thanks!










share|improve this question


















  • 1




    I didn't understand correctly. Can you add an example of what you want to achieve in the end but can't?
    – AndréC
    15 mins ago
















1














I have been drawing some pictures using tikz, and am wondering if I can name a number.



For example, I pick a point $A$ with position angle $alpha=45degree$ on a circle, and a line going through that point with direction angle $beta=alpha+90degree=135degree$ (with is perpendicular to the position vector).



Later I change the point $A$ to be $alpha=60degree$, and then $beta=150 degree$.



Now I change both angles manually. If I can name the first angle $alpha$ and the second angle $beta$, then I only need to change $alpha$: $beta$ will vary accordingly.



Is there a way to do this, naming a number? Thanks!










share|improve this question


















  • 1




    I didn't understand correctly. Can you add an example of what you want to achieve in the end but can't?
    – AndréC
    15 mins ago














1












1








1







I have been drawing some pictures using tikz, and am wondering if I can name a number.



For example, I pick a point $A$ with position angle $alpha=45degree$ on a circle, and a line going through that point with direction angle $beta=alpha+90degree=135degree$ (with is perpendicular to the position vector).



Later I change the point $A$ to be $alpha=60degree$, and then $beta=150 degree$.



Now I change both angles manually. If I can name the first angle $alpha$ and the second angle $beta$, then I only need to change $alpha$: $beta$ will vary accordingly.



Is there a way to do this, naming a number? Thanks!










share|improve this question













I have been drawing some pictures using tikz, and am wondering if I can name a number.



For example, I pick a point $A$ with position angle $alpha=45degree$ on a circle, and a line going through that point with direction angle $beta=alpha+90degree=135degree$ (with is perpendicular to the position vector).



Later I change the point $A$ to be $alpha=60degree$, and then $beta=150 degree$.



Now I change both angles manually. If I can name the first angle $alpha$ and the second angle $beta$, then I only need to change $alpha$: $beta$ will vary accordingly.



Is there a way to do this, naming a number? Thanks!







tikz-pgf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 29 mins ago









Pengfei

1165




1165








  • 1




    I didn't understand correctly. Can you add an example of what you want to achieve in the end but can't?
    – AndréC
    15 mins ago














  • 1




    I didn't understand correctly. Can you add an example of what you want to achieve in the end but can't?
    – AndréC
    15 mins ago








1




1




I didn't understand correctly. Can you add an example of what you want to achieve in the end but can't?
– AndréC
15 mins ago




I didn't understand correctly. Can you add an example of what you want to achieve in the end but can't?
– AndréC
15 mins ago










1 Answer
1






active

oldest

votes


















0














You can use insert path in order to insert paths that are largely the same. This is illustrated in the MWE most of which is illustration.



documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[insert points/.style={insert path={%
(#1:1) coordinate(A) (#1+90:1) coordinate(B)}}]
% with 45 degrees
path[insert points=45];
% only illustration
draw circle (1);
foreach X in {A,B}
{node[fill,inner sep=1pt,label=right:X] at (X){};}
% second example (shifted to avoid interference)
begin{scope}[xshift=4cm]
% with 60 degrees
path[insert points=60];
% only illustration
draw circle (1);
foreach X in {A,B}
{node[fill,inner sep=1pt,label=right:X] at (X){};}
end{scope}
end{tikzpicture}
end{document}


enter image description here





share





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    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
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467305%2fcould-i-name-a-number-in-tikz%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can use insert path in order to insert paths that are largely the same. This is illustrated in the MWE most of which is illustration.



    documentclass[tikz,border=3.14mm]{standalone}
    begin{document}
    begin{tikzpicture}[insert points/.style={insert path={%
    (#1:1) coordinate(A) (#1+90:1) coordinate(B)}}]
    % with 45 degrees
    path[insert points=45];
    % only illustration
    draw circle (1);
    foreach X in {A,B}
    {node[fill,inner sep=1pt,label=right:X] at (X){};}
    % second example (shifted to avoid interference)
    begin{scope}[xshift=4cm]
    % with 60 degrees
    path[insert points=60];
    % only illustration
    draw circle (1);
    foreach X in {A,B}
    {node[fill,inner sep=1pt,label=right:X] at (X){};}
    end{scope}
    end{tikzpicture}
    end{document}


    enter image description here





    share


























      0














      You can use insert path in order to insert paths that are largely the same. This is illustrated in the MWE most of which is illustration.



      documentclass[tikz,border=3.14mm]{standalone}
      begin{document}
      begin{tikzpicture}[insert points/.style={insert path={%
      (#1:1) coordinate(A) (#1+90:1) coordinate(B)}}]
      % with 45 degrees
      path[insert points=45];
      % only illustration
      draw circle (1);
      foreach X in {A,B}
      {node[fill,inner sep=1pt,label=right:X] at (X){};}
      % second example (shifted to avoid interference)
      begin{scope}[xshift=4cm]
      % with 60 degrees
      path[insert points=60];
      % only illustration
      draw circle (1);
      foreach X in {A,B}
      {node[fill,inner sep=1pt,label=right:X] at (X){};}
      end{scope}
      end{tikzpicture}
      end{document}


      enter image description here





      share
























        0












        0








        0






        You can use insert path in order to insert paths that are largely the same. This is illustrated in the MWE most of which is illustration.



        documentclass[tikz,border=3.14mm]{standalone}
        begin{document}
        begin{tikzpicture}[insert points/.style={insert path={%
        (#1:1) coordinate(A) (#1+90:1) coordinate(B)}}]
        % with 45 degrees
        path[insert points=45];
        % only illustration
        draw circle (1);
        foreach X in {A,B}
        {node[fill,inner sep=1pt,label=right:X] at (X){};}
        % second example (shifted to avoid interference)
        begin{scope}[xshift=4cm]
        % with 60 degrees
        path[insert points=60];
        % only illustration
        draw circle (1);
        foreach X in {A,B}
        {node[fill,inner sep=1pt,label=right:X] at (X){};}
        end{scope}
        end{tikzpicture}
        end{document}


        enter image description here





        share












        You can use insert path in order to insert paths that are largely the same. This is illustrated in the MWE most of which is illustration.



        documentclass[tikz,border=3.14mm]{standalone}
        begin{document}
        begin{tikzpicture}[insert points/.style={insert path={%
        (#1:1) coordinate(A) (#1+90:1) coordinate(B)}}]
        % with 45 degrees
        path[insert points=45];
        % only illustration
        draw circle (1);
        foreach X in {A,B}
        {node[fill,inner sep=1pt,label=right:X] at (X){};}
        % second example (shifted to avoid interference)
        begin{scope}[xshift=4cm]
        % with 60 degrees
        path[insert points=60];
        % only illustration
        draw circle (1);
        foreach X in {A,B}
        {node[fill,inner sep=1pt,label=right:X] at (X){};}
        end{scope}
        end{tikzpicture}
        end{document}


        enter image description here






        share











        share


        share










        answered 8 mins ago









        marmot

        85.8k498183




        85.8k498183






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX 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.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467305%2fcould-i-name-a-number-in-tikz%23new-answer', 'question_page');
            }
            );

            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







            Popular posts from this blog

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt