Incomplete iffalse: How to shift a scope in polar coordinate?Incomplete iffalse using pgfmath naming a TikZ nodeIs there a polar coordinate registers in the let command?Nested scope shift in nested tikzpictures?Using coordinate expressions in scope transformstikz shift coordinate rectangleLine up nested tikz enviroments or how to get rid of themhow to use 3d polar coordinate systemHow to resolve an incomplete iffalse error?Tikz: incomplete iffalse error with pgfmathparse
Booting Ubuntu from USB drive on MSI motherboard -- EVERYTHING fails
How deep is the liquid in a half-full hemisphere?
A word that refers to saying something in an attempt to anger or embarrass someone into doing something that they don’t want to do?
Can you cure a Gorgon's Petrifying Breath before it finishes turning a target to stone?
Diminished data rate with logic output optoisolator
Sci-fi movie with one survivor and an organism(?) recreating his memories
Why does `FindFit` fail so badly in this simple case?
How to identify whether a publisher is genuine or not?
To what degree did the Supreme Court limit Boris Johnson's ability to prorogue?
Why such a singular place for bird watching?
grounded outlets and code compliance
Smallest PRIME containing the first 11 primes as sub-strings
Knights and Knaves: What does C say?
The differences amongst f[x_], f[x__], and f[x___]
Criteria for representability of a functor from schemes to sets
As a team leader is it appropriate to bring in fundraiser candy?
Is it possible to take a database offline when doing a backup using an SQL job?
Creating specific options in `Manipulate[]`
How do we know neutrons have no charge?
Garage door sticks on a bolt
Why has Speaker Pelosi been so hesitant to impeach President Trump?
Was the ruling that prorogation was unlawful only possible because of the creation of a separate supreme court?
Did Tolkien ever write about a Heaven or Hell for Men?
Writing a program that will filter the integer solutions
Incomplete iffalse: How to shift a scope in polar coordinate?
Incomplete iffalse using pgfmath naming a TikZ nodeIs there a polar coordinate registers in the let command?Nested scope shift in nested tikzpictures?Using coordinate expressions in scope transformstikz shift coordinate rectangleLine up nested tikz enviroments or how to get rid of themhow to use 3d polar coordinate systemHow to resolve an incomplete iffalse error?Tikz: incomplete iffalse error with pgfmathparse
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to shift some scope
environment according to polar variables not xshift
and yshift
. Assuming that this feature is not already implemented (is it?!) and I am not reinventing a wheel, I thought that would be a good opportunity to wrestle with pgf
stuffs to do it myself.
Here is what I've tried:
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift = pgfmathparsemultiply(#1,cos(#2))
yshift = pgfmathparsemultiply(#1,sin(#2))
begindocument
begintikzpicture
object;
beginscope[polarshift6030]
object;
endscope
endtikzpicture
enddocument
But LaTeX compalains like: Incomplete iffalse.
What is the problem with this snippet?
tikz-pgf
add a comment
|
I need to shift some scope
environment according to polar variables not xshift
and yshift
. Assuming that this feature is not already implemented (is it?!) and I am not reinventing a wheel, I thought that would be a good opportunity to wrestle with pgf
stuffs to do it myself.
Here is what I've tried:
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift = pgfmathparsemultiply(#1,cos(#2))
yshift = pgfmathparsemultiply(#1,sin(#2))
begindocument
begintikzpicture
object;
beginscope[polarshift6030]
object;
endscope
endtikzpicture
enddocument
But LaTeX compalains like: Incomplete iffalse.
What is the problem with this snippet?
tikz-pgf
You definepolarshift
with two mandatory arguments but only provide a[
...]
-delimited argument. Trybeginscope[polarshift6030]
.
– Phelype Oleinik
18 hours ago
@PhelypeOleinik: Thanks, yet that error pops up as before.
– Roboticist
18 hours ago
add a comment
|
I need to shift some scope
environment according to polar variables not xshift
and yshift
. Assuming that this feature is not already implemented (is it?!) and I am not reinventing a wheel, I thought that would be a good opportunity to wrestle with pgf
stuffs to do it myself.
Here is what I've tried:
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift = pgfmathparsemultiply(#1,cos(#2))
yshift = pgfmathparsemultiply(#1,sin(#2))
begindocument
begintikzpicture
object;
beginscope[polarshift6030]
object;
endscope
endtikzpicture
enddocument
But LaTeX compalains like: Incomplete iffalse.
What is the problem with this snippet?
tikz-pgf
I need to shift some scope
environment according to polar variables not xshift
and yshift
. Assuming that this feature is not already implemented (is it?!) and I am not reinventing a wheel, I thought that would be a good opportunity to wrestle with pgf
stuffs to do it myself.
Here is what I've tried:
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift = pgfmathparsemultiply(#1,cos(#2))
yshift = pgfmathparsemultiply(#1,sin(#2))
begindocument
begintikzpicture
object;
beginscope[polarshift6030]
object;
endscope
endtikzpicture
enddocument
But LaTeX compalains like: Incomplete iffalse.
What is the problem with this snippet?
tikz-pgf
tikz-pgf
edited 18 hours ago
Roboticist
asked 18 hours ago
RoboticistRoboticist
1,7492 gold badges15 silver badges33 bronze badges
1,7492 gold badges15 silver badges33 bronze badges
You definepolarshift
with two mandatory arguments but only provide a[
...]
-delimited argument. Trybeginscope[polarshift6030]
.
– Phelype Oleinik
18 hours ago
@PhelypeOleinik: Thanks, yet that error pops up as before.
– Roboticist
18 hours ago
add a comment
|
You definepolarshift
with two mandatory arguments but only provide a[
...]
-delimited argument. Trybeginscope[polarshift6030]
.
– Phelype Oleinik
18 hours ago
@PhelypeOleinik: Thanks, yet that error pops up as before.
– Roboticist
18 hours ago
You define
polarshift
with two mandatory arguments but only provide a [
...]
-delimited argument. Try beginscope[polarshift6030]
.– Phelype Oleinik
18 hours ago
You define
polarshift
with two mandatory arguments but only provide a [
...]
-delimited argument. Try beginscope[polarshift6030]
.– Phelype Oleinik
18 hours ago
@PhelypeOleinik: Thanks, yet that error pops up as before.
– Roboticist
18 hours ago
@PhelypeOleinik: Thanks, yet that error pops up as before.
– Roboticist
18 hours ago
add a comment
|
3 Answers
3
active
oldest
votes
This is an attempt to convince you to make things more TikZy. Instead of a macro object
it is arguably better to define a pic
object
. Then the shift is just the (relative) coordinate of the pic
:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) picobject ;
endtikzpicture
enddocument
As you see, the code becomes much shorter. And it is easier to customize things:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red,pic actions] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) pic[rotate=30,scale=1.2,dashed,draw=blue]object ;
endtikzpicture
enddocument
ADDENDUM: as for your comment: of course, your approach can be made work, too. First of all, TikZ automatically parses these expressions, so there is no need to say pgfmathparse
. Other than that you are missing a comma, and you need to expand the macro.
documentclass[tikz]standalone
%usepackagegraphicx %<-loaded by tikz
%usepackagepgf% <- loaded by tikz
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift =#1*cos(#2),
yshift =#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[style/.expanded=polarshift6030]
object;
endscope
endtikzpicture
enddocument
This is definitely a better approach than writing that macro.;-)
Nevertheless, I chose the pgf way of doing to it to learn a bit about pgf. Currently, 3 (pretty experienced) users have answered this question, yet none of them fixed the problem of my code. So, I'm just wondering whether or not this thing is even doable by pgf macros! Can you please share your thoughts about this feasibility?
– Roboticist
15 hours ago
2
@Roboticist Of course your approach can be made work, too. There are two main issues, a missing comma and a missing expansion. See my addendum.
– Schrödinger's cat
15 hours ago
1
You're helpful regardless of any label you carry, marmot or cat...
– Roboticist
15 hours ago
add a comment
|
It seems that commands can't be used as option of scope
. Try the following:
documentclass[tikz, margin=3mm]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
tikzsetpolarshift/.style args=#1/#2xshift=#1*cos(#2),yshift=#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[polarshift=60/30]
object;
endscope
endtikzpicture
enddocument
add a comment
|
If I understood your problem correctly, just shift it to a polar coordinate
:
beginscope[shift=(30:2)]
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
%newcommandpolarshift[2]
% xshift = pgfmathparsemultiply(#1,cos(#2))
% yshift = pgfmathparsemultiply(#1,sin(#2))
%
begindocument
begintikzpicture
object;
beginscope[shift=(30:2)]
object;
endscope
endtikzpicture
enddocument
add a comment
|
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/4.0/"u003ecc by-sa 4.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%2ftex.stackexchange.com%2fquestions%2f509584%2fincomplete-iffalse-how-to-shift-a-scope-in-polar-coordinate%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is an attempt to convince you to make things more TikZy. Instead of a macro object
it is arguably better to define a pic
object
. Then the shift is just the (relative) coordinate of the pic
:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) picobject ;
endtikzpicture
enddocument
As you see, the code becomes much shorter. And it is easier to customize things:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red,pic actions] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) pic[rotate=30,scale=1.2,dashed,draw=blue]object ;
endtikzpicture
enddocument
ADDENDUM: as for your comment: of course, your approach can be made work, too. First of all, TikZ automatically parses these expressions, so there is no need to say pgfmathparse
. Other than that you are missing a comma, and you need to expand the macro.
documentclass[tikz]standalone
%usepackagegraphicx %<-loaded by tikz
%usepackagepgf% <- loaded by tikz
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift =#1*cos(#2),
yshift =#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[style/.expanded=polarshift6030]
object;
endscope
endtikzpicture
enddocument
This is definitely a better approach than writing that macro.;-)
Nevertheless, I chose the pgf way of doing to it to learn a bit about pgf. Currently, 3 (pretty experienced) users have answered this question, yet none of them fixed the problem of my code. So, I'm just wondering whether or not this thing is even doable by pgf macros! Can you please share your thoughts about this feasibility?
– Roboticist
15 hours ago
2
@Roboticist Of course your approach can be made work, too. There are two main issues, a missing comma and a missing expansion. See my addendum.
– Schrödinger's cat
15 hours ago
1
You're helpful regardless of any label you carry, marmot or cat...
– Roboticist
15 hours ago
add a comment
|
This is an attempt to convince you to make things more TikZy. Instead of a macro object
it is arguably better to define a pic
object
. Then the shift is just the (relative) coordinate of the pic
:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) picobject ;
endtikzpicture
enddocument
As you see, the code becomes much shorter. And it is easier to customize things:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red,pic actions] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) pic[rotate=30,scale=1.2,dashed,draw=blue]object ;
endtikzpicture
enddocument
ADDENDUM: as for your comment: of course, your approach can be made work, too. First of all, TikZ automatically parses these expressions, so there is no need to say pgfmathparse
. Other than that you are missing a comma, and you need to expand the macro.
documentclass[tikz]standalone
%usepackagegraphicx %<-loaded by tikz
%usepackagepgf% <- loaded by tikz
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift =#1*cos(#2),
yshift =#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[style/.expanded=polarshift6030]
object;
endscope
endtikzpicture
enddocument
This is definitely a better approach than writing that macro.;-)
Nevertheless, I chose the pgf way of doing to it to learn a bit about pgf. Currently, 3 (pretty experienced) users have answered this question, yet none of them fixed the problem of my code. So, I'm just wondering whether or not this thing is even doable by pgf macros! Can you please share your thoughts about this feasibility?
– Roboticist
15 hours ago
2
@Roboticist Of course your approach can be made work, too. There are two main issues, a missing comma and a missing expansion. See my addendum.
– Schrödinger's cat
15 hours ago
1
You're helpful regardless of any label you carry, marmot or cat...
– Roboticist
15 hours ago
add a comment
|
This is an attempt to convince you to make things more TikZy. Instead of a macro object
it is arguably better to define a pic
object
. Then the shift is just the (relative) coordinate of the pic
:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) picobject ;
endtikzpicture
enddocument
As you see, the code becomes much shorter. And it is easier to customize things:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red,pic actions] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) pic[rotate=30,scale=1.2,dashed,draw=blue]object ;
endtikzpicture
enddocument
ADDENDUM: as for your comment: of course, your approach can be made work, too. First of all, TikZ automatically parses these expressions, so there is no need to say pgfmathparse
. Other than that you are missing a comma, and you need to expand the macro.
documentclass[tikz]standalone
%usepackagegraphicx %<-loaded by tikz
%usepackagepgf% <- loaded by tikz
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift =#1*cos(#2),
yshift =#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[style/.expanded=polarshift6030]
object;
endscope
endtikzpicture
enddocument
This is an attempt to convince you to make things more TikZy. Instead of a macro object
it is arguably better to define a pic
object
. Then the shift is just the (relative) coordinate of the pic
:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) picobject ;
endtikzpicture
enddocument
As you see, the code becomes much shorter. And it is easier to customize things:
documentclass[tikz]standalone
begindocument
begintikzpicture[pics/object/.style=
code=draw[fill=red,pic actions] (0,0) rectangle ++(2,2);]
path picobject (30:60pt) pic[rotate=30,scale=1.2,dashed,draw=blue]object ;
endtikzpicture
enddocument
ADDENDUM: as for your comment: of course, your approach can be made work, too. First of all, TikZ automatically parses these expressions, so there is no need to say pgfmathparse
. Other than that you are missing a comma, and you need to expand the macro.
documentclass[tikz]standalone
%usepackagegraphicx %<-loaded by tikz
%usepackagepgf% <- loaded by tikz
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
newcommandpolarshift[2]
xshift =#1*cos(#2),
yshift =#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[style/.expanded=polarshift6030]
object;
endscope
endtikzpicture
enddocument
edited 15 hours ago
answered 16 hours ago
Schrödinger's catSchrödinger's cat
9,57013 silver badges28 bronze badges
9,57013 silver badges28 bronze badges
This is definitely a better approach than writing that macro.;-)
Nevertheless, I chose the pgf way of doing to it to learn a bit about pgf. Currently, 3 (pretty experienced) users have answered this question, yet none of them fixed the problem of my code. So, I'm just wondering whether or not this thing is even doable by pgf macros! Can you please share your thoughts about this feasibility?
– Roboticist
15 hours ago
2
@Roboticist Of course your approach can be made work, too. There are two main issues, a missing comma and a missing expansion. See my addendum.
– Schrödinger's cat
15 hours ago
1
You're helpful regardless of any label you carry, marmot or cat...
– Roboticist
15 hours ago
add a comment
|
This is definitely a better approach than writing that macro.;-)
Nevertheless, I chose the pgf way of doing to it to learn a bit about pgf. Currently, 3 (pretty experienced) users have answered this question, yet none of them fixed the problem of my code. So, I'm just wondering whether or not this thing is even doable by pgf macros! Can you please share your thoughts about this feasibility?
– Roboticist
15 hours ago
2
@Roboticist Of course your approach can be made work, too. There are two main issues, a missing comma and a missing expansion. See my addendum.
– Schrödinger's cat
15 hours ago
1
You're helpful regardless of any label you carry, marmot or cat...
– Roboticist
15 hours ago
This is definitely a better approach than writing that macro.
;-)
Nevertheless, I chose the pgf way of doing to it to learn a bit about pgf. Currently, 3 (pretty experienced) users have answered this question, yet none of them fixed the problem of my code. So, I'm just wondering whether or not this thing is even doable by pgf macros! Can you please share your thoughts about this feasibility?– Roboticist
15 hours ago
This is definitely a better approach than writing that macro.
;-)
Nevertheless, I chose the pgf way of doing to it to learn a bit about pgf. Currently, 3 (pretty experienced) users have answered this question, yet none of them fixed the problem of my code. So, I'm just wondering whether or not this thing is even doable by pgf macros! Can you please share your thoughts about this feasibility?– Roboticist
15 hours ago
2
2
@Roboticist Of course your approach can be made work, too. There are two main issues, a missing comma and a missing expansion. See my addendum.
– Schrödinger's cat
15 hours ago
@Roboticist Of course your approach can be made work, too. There are two main issues, a missing comma and a missing expansion. See my addendum.
– Schrödinger's cat
15 hours ago
1
1
You're helpful regardless of any label you carry, marmot or cat...
– Roboticist
15 hours ago
You're helpful regardless of any label you carry, marmot or cat...
– Roboticist
15 hours ago
add a comment
|
It seems that commands can't be used as option of scope
. Try the following:
documentclass[tikz, margin=3mm]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
tikzsetpolarshift/.style args=#1/#2xshift=#1*cos(#2),yshift=#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[polarshift=60/30]
object;
endscope
endtikzpicture
enddocument
add a comment
|
It seems that commands can't be used as option of scope
. Try the following:
documentclass[tikz, margin=3mm]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
tikzsetpolarshift/.style args=#1/#2xshift=#1*cos(#2),yshift=#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[polarshift=60/30]
object;
endscope
endtikzpicture
enddocument
add a comment
|
It seems that commands can't be used as option of scope
. Try the following:
documentclass[tikz, margin=3mm]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
tikzsetpolarshift/.style args=#1/#2xshift=#1*cos(#2),yshift=#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[polarshift=60/30]
object;
endscope
endtikzpicture
enddocument
It seems that commands can't be used as option of scope
. Try the following:
documentclass[tikz, margin=3mm]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
tikzsetpolarshift/.style args=#1/#2xshift=#1*cos(#2),yshift=#1*sin(#2)
begindocument
begintikzpicture
object;
beginscope[polarshift=60/30]
object;
endscope
endtikzpicture
enddocument
edited 17 hours ago
answered 17 hours ago
ZarkoZarko
148k8 gold badges85 silver badges195 bronze badges
148k8 gold badges85 silver badges195 bronze badges
add a comment
|
add a comment
|
If I understood your problem correctly, just shift it to a polar coordinate
:
beginscope[shift=(30:2)]
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
%newcommandpolarshift[2]
% xshift = pgfmathparsemultiply(#1,cos(#2))
% yshift = pgfmathparsemultiply(#1,sin(#2))
%
begindocument
begintikzpicture
object;
beginscope[shift=(30:2)]
object;
endscope
endtikzpicture
enddocument
add a comment
|
If I understood your problem correctly, just shift it to a polar coordinate
:
beginscope[shift=(30:2)]
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
%newcommandpolarshift[2]
% xshift = pgfmathparsemultiply(#1,cos(#2))
% yshift = pgfmathparsemultiply(#1,sin(#2))
%
begindocument
begintikzpicture
object;
beginscope[shift=(30:2)]
object;
endscope
endtikzpicture
enddocument
add a comment
|
If I understood your problem correctly, just shift it to a polar coordinate
:
beginscope[shift=(30:2)]
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
%newcommandpolarshift[2]
% xshift = pgfmathparsemultiply(#1,cos(#2))
% yshift = pgfmathparsemultiply(#1,sin(#2))
%
begindocument
begintikzpicture
object;
beginscope[shift=(30:2)]
object;
endscope
endtikzpicture
enddocument
If I understood your problem correctly, just shift it to a polar coordinate
:
beginscope[shift=(30:2)]
documentclass[tikz]standalone
usepackagegraphicx
usepackagepgf
newcommandobject
draw[fill=red] (0,0) rectangle ++(2,2);
%newcommandpolarshift[2]
% xshift = pgfmathparsemultiply(#1,cos(#2))
% yshift = pgfmathparsemultiply(#1,sin(#2))
%
begindocument
begintikzpicture
object;
beginscope[shift=(30:2)]
object;
endscope
endtikzpicture
enddocument
answered 17 hours ago
AndréCAndréC
13k2 gold badges18 silver badges55 bronze badges
13k2 gold badges18 silver badges55 bronze badges
add a comment
|
add a comment
|
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.
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%2ftex.stackexchange.com%2fquestions%2f509584%2fincomplete-iffalse-how-to-shift-a-scope-in-polar-coordinate%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
You define
polarshift
with two mandatory arguments but only provide a[
...]
-delimited argument. Trybeginscope[polarshift6030]
.– Phelype Oleinik
18 hours ago
@PhelypeOleinik: Thanks, yet that error pops up as before.
– Roboticist
18 hours ago