Modify real part and leaves imaginary part unchangedpresenting a real number as real instead of imaginaryHow to eliminate the zero real part of a purely imaginary number?Solve equations real and imaginary part separatelyDecomposing a complex numbers equation into its real and imaginary partListplot imaginary part of complex numbersContour plot of the imaginary portion of a function given the real part is positiveImaginary part of complex number, nothing works?
How a square wave is generated?
Is trying to learn day trading a complete waste of time?
Finishing pre-cooked prime rib, day-of?
Why use an adjective after a noun?
5yrs old being bossy... Is this too much or tolerable at this age?
Updated: Questions on implementing Builder design pattern
Behaviour of verb that looks pronomial but doesn't have a "se" entry in the dictionary?
As of 2019, why do mountaineering courses still teach how to use a paper map?
How to prevent humanity from using alien spaceships and technology exclusively?
Why my vim doesn't support hex color code?
Does the three-clause BSD license hinder academic citations?
Taking a Switch on vacation from EU to USA. What region eshop will I be able to access?
Peptide bond formation in acidic and basic amino acids
Can I use baking powder in place of baking soda for dipping pretzels?
smallest number obtainable from 2020
Creating outer glow effect depending on the graduated symbology color of a shapefile - QGIS
Should I take a side in an external player conflict, or let my game die?
Carlsen beat a high ranking GM with 1 Nh3. Conclusions?
"Can't open display" when using `scp`
Where should I place my fictional continent in the South Pacific?
Why are the 4th and 7th scale degrees removed from the major scale to make the Pentatonic scale?
Sum of primes under a certain number
If a very huge Earthquake occured anywhere on Earth could waves emerge to come together again on the opposite side?
What range of heights are allowed for wall receptacles?
Modify real part and leaves imaginary part unchanged
presenting a real number as real instead of imaginaryHow to eliminate the zero real part of a purely imaginary number?Solve equations real and imaginary part separatelyDecomposing a complex numbers equation into its real and imaginary partListplot imaginary part of complex numbersContour plot of the imaginary portion of a function given the real part is positiveImaginary part of complex number, nothing works?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
.everyonelovesstackoverflowposition:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;
$begingroup$
How can I flip the sign of the real part but not affect the imaginary part of a complex number:
a+bi => -a + bi
Example list:
list = -0.282095 + 0.282095 I, -0.27254 + 0.291336 I,
-0.262018 + 0.300835 I, -0.250437 + 0.310542 I
expected:
0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I
So it's "similar" to conjugate but works on the real not imaginary.
complex
$endgroup$
add a comment
|
$begingroup$
How can I flip the sign of the real part but not affect the imaginary part of a complex number:
a+bi => -a + bi
Example list:
list = -0.282095 + 0.282095 I, -0.27254 + 0.291336 I,
-0.262018 + 0.300835 I, -0.250437 + 0.310542 I
expected:
0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I
So it's "similar" to conjugate but works on the real not imaginary.
complex
$endgroup$
add a comment
|
$begingroup$
How can I flip the sign of the real part but not affect the imaginary part of a complex number:
a+bi => -a + bi
Example list:
list = -0.282095 + 0.282095 I, -0.27254 + 0.291336 I,
-0.262018 + 0.300835 I, -0.250437 + 0.310542 I
expected:
0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I
So it's "similar" to conjugate but works on the real not imaginary.
complex
$endgroup$
How can I flip the sign of the real part but not affect the imaginary part of a complex number:
a+bi => -a + bi
Example list:
list = -0.282095 + 0.282095 I, -0.27254 + 0.291336 I,
-0.262018 + 0.300835 I, -0.250437 + 0.310542 I
expected:
0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I
So it's "similar" to conjugate but works on the real not imaginary.
complex
complex
asked Oct 1 at 22:41
leon365leon365
5892 silver badges7 bronze badges
5892 silver badges7 bronze badges
add a comment
|
add a comment
|
3 Answers
3
active
oldest
votes
$begingroup$
-Conjugate[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
$endgroup$
$begingroup$
This is not even a Mathematica but a Math answer. I like it
$endgroup$
– infinitezero
Oct 2 at 12:06
add a comment
|
$begingroup$
list /. Complex[x_, y_] :> Complex[-x, y]
0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I,
0.250437 + 0.310542 I, 2, 3 I
$endgroup$
1
$begingroup$
This assumes that all entries are trulyComplex[_,_]. But for a list-0.282095 + 0.282095 I, -0.3445, which also contains only complex numbers (although one of them happens to be purely real, and even haveRealhead), this won't work correctly.
$endgroup$
– Ruslan
Oct 3 at 5:20
$begingroup$
Agreed. This solution is for complex numbers of the form a + b i that was asked in the question. To include real numbers it needs to be modified toComplex[x_,y_]:>Complex[-x,y], x_:>-x.
$endgroup$
– Suba Thomas
Oct 3 at 14:21
$begingroup$
Actually this would also break for "complex" number like e.g.1.234+0I, which actually collapses to aReal
$endgroup$
– Ruslan
Oct 3 at 14:23
add a comment
|
$begingroup$
f[z_] = -Re[z] + I Im[z]
f[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
$endgroup$
add a comment
|
Your Answer
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/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%2fmathematica.stackexchange.com%2fquestions%2f207188%2fmodify-real-part-and-leaves-imaginary-part-unchanged%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
$begingroup$
-Conjugate[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
$endgroup$
$begingroup$
This is not even a Mathematica but a Math answer. I like it
$endgroup$
– infinitezero
Oct 2 at 12:06
add a comment
|
$begingroup$
-Conjugate[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
$endgroup$
$begingroup$
This is not even a Mathematica but a Math answer. I like it
$endgroup$
– infinitezero
Oct 2 at 12:06
add a comment
|
$begingroup$
-Conjugate[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
$endgroup$
-Conjugate[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I,
0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
answered Oct 1 at 22:48
WReachWReach
57k2 gold badges126 silver badges225 bronze badges
57k2 gold badges126 silver badges225 bronze badges
$begingroup$
This is not even a Mathematica but a Math answer. I like it
$endgroup$
– infinitezero
Oct 2 at 12:06
add a comment
|
$begingroup$
This is not even a Mathematica but a Math answer. I like it
$endgroup$
– infinitezero
Oct 2 at 12:06
$begingroup$
This is not even a Mathematica but a Math answer. I like it
$endgroup$
– infinitezero
Oct 2 at 12:06
$begingroup$
This is not even a Mathematica but a Math answer. I like it
$endgroup$
– infinitezero
Oct 2 at 12:06
add a comment
|
$begingroup$
list /. Complex[x_, y_] :> Complex[-x, y]
0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I,
0.250437 + 0.310542 I, 2, 3 I
$endgroup$
1
$begingroup$
This assumes that all entries are trulyComplex[_,_]. But for a list-0.282095 + 0.282095 I, -0.3445, which also contains only complex numbers (although one of them happens to be purely real, and even haveRealhead), this won't work correctly.
$endgroup$
– Ruslan
Oct 3 at 5:20
$begingroup$
Agreed. This solution is for complex numbers of the form a + b i that was asked in the question. To include real numbers it needs to be modified toComplex[x_,y_]:>Complex[-x,y], x_:>-x.
$endgroup$
– Suba Thomas
Oct 3 at 14:21
$begingroup$
Actually this would also break for "complex" number like e.g.1.234+0I, which actually collapses to aReal
$endgroup$
– Ruslan
Oct 3 at 14:23
add a comment
|
$begingroup$
list /. Complex[x_, y_] :> Complex[-x, y]
0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I,
0.250437 + 0.310542 I, 2, 3 I
$endgroup$
1
$begingroup$
This assumes that all entries are trulyComplex[_,_]. But for a list-0.282095 + 0.282095 I, -0.3445, which also contains only complex numbers (although one of them happens to be purely real, and even haveRealhead), this won't work correctly.
$endgroup$
– Ruslan
Oct 3 at 5:20
$begingroup$
Agreed. This solution is for complex numbers of the form a + b i that was asked in the question. To include real numbers it needs to be modified toComplex[x_,y_]:>Complex[-x,y], x_:>-x.
$endgroup$
– Suba Thomas
Oct 3 at 14:21
$begingroup$
Actually this would also break for "complex" number like e.g.1.234+0I, which actually collapses to aReal
$endgroup$
– Ruslan
Oct 3 at 14:23
add a comment
|
$begingroup$
list /. Complex[x_, y_] :> Complex[-x, y]
0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I,
0.250437 + 0.310542 I, 2, 3 I
$endgroup$
list /. Complex[x_, y_] :> Complex[-x, y]
0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I,
0.250437 + 0.310542 I, 2, 3 I
answered Oct 1 at 22:47
Suba ThomasSuba Thomas
5,08911 silver badges20 bronze badges
5,08911 silver badges20 bronze badges
1
$begingroup$
This assumes that all entries are trulyComplex[_,_]. But for a list-0.282095 + 0.282095 I, -0.3445, which also contains only complex numbers (although one of them happens to be purely real, and even haveRealhead), this won't work correctly.
$endgroup$
– Ruslan
Oct 3 at 5:20
$begingroup$
Agreed. This solution is for complex numbers of the form a + b i that was asked in the question. To include real numbers it needs to be modified toComplex[x_,y_]:>Complex[-x,y], x_:>-x.
$endgroup$
– Suba Thomas
Oct 3 at 14:21
$begingroup$
Actually this would also break for "complex" number like e.g.1.234+0I, which actually collapses to aReal
$endgroup$
– Ruslan
Oct 3 at 14:23
add a comment
|
1
$begingroup$
This assumes that all entries are trulyComplex[_,_]. But for a list-0.282095 + 0.282095 I, -0.3445, which also contains only complex numbers (although one of them happens to be purely real, and even haveRealhead), this won't work correctly.
$endgroup$
– Ruslan
Oct 3 at 5:20
$begingroup$
Agreed. This solution is for complex numbers of the form a + b i that was asked in the question. To include real numbers it needs to be modified toComplex[x_,y_]:>Complex[-x,y], x_:>-x.
$endgroup$
– Suba Thomas
Oct 3 at 14:21
$begingroup$
Actually this would also break for "complex" number like e.g.1.234+0I, which actually collapses to aReal
$endgroup$
– Ruslan
Oct 3 at 14:23
1
1
$begingroup$
This assumes that all entries are truly
Complex[_,_]. But for a list -0.282095 + 0.282095 I, -0.3445, which also contains only complex numbers (although one of them happens to be purely real, and even have Real head), this won't work correctly.$endgroup$
– Ruslan
Oct 3 at 5:20
$begingroup$
This assumes that all entries are truly
Complex[_,_]. But for a list -0.282095 + 0.282095 I, -0.3445, which also contains only complex numbers (although one of them happens to be purely real, and even have Real head), this won't work correctly.$endgroup$
– Ruslan
Oct 3 at 5:20
$begingroup$
Agreed. This solution is for complex numbers of the form a + b i that was asked in the question. To include real numbers it needs to be modified to
Complex[x_,y_]:>Complex[-x,y], x_:>-x.$endgroup$
– Suba Thomas
Oct 3 at 14:21
$begingroup$
Agreed. This solution is for complex numbers of the form a + b i that was asked in the question. To include real numbers it needs to be modified to
Complex[x_,y_]:>Complex[-x,y], x_:>-x.$endgroup$
– Suba Thomas
Oct 3 at 14:21
$begingroup$
Actually this would also break for "complex" number like e.g.
1.234+0I, which actually collapses to a Real$endgroup$
– Ruslan
Oct 3 at 14:23
$begingroup$
Actually this would also break for "complex" number like e.g.
1.234+0I, which actually collapses to a Real$endgroup$
– Ruslan
Oct 3 at 14:23
add a comment
|
$begingroup$
f[z_] = -Re[z] + I Im[z]
f[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
$endgroup$
add a comment
|
$begingroup$
f[z_] = -Re[z] + I Im[z]
f[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
$endgroup$
add a comment
|
$begingroup$
f[z_] = -Re[z] + I Im[z]
f[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
$endgroup$
f[z_] = -Re[z] + I Im[z]
f[list]
(* 0.282095 + 0.282095 I, 0.27254 + 0.291336 I, 0.262018 + 0.300835 I, 0.250437 + 0.310542 I *)
answered Oct 2 at 18:26
Michael SeifertMichael Seifert
7,75415 silver badges43 bronze badges
7,75415 silver badges43 bronze badges
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%2f207188%2fmodify-real-part-and-leaves-imaginary-part-unchanged%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