Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.9K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

[?] Plot 2-D linear combinations with general coefficients?

Posted 9 years ago
Attachments:
POSTED BY: Arthur Hill
4 Replies

If you enclose s {2, 4}, (1 - s) {4, 2} within braces, it becomes a 2 by 2 matrix, not a vector. If you want a linear (convex) combination of the vectors {2,4} and {4,2} you should combine them with a plus sign:

Graphics[Table[
  Arrow[{{0, 0}, s {2, 4} + (1 - s) {4, 2}}], {s, 0, 1, 0.025}]]
POSTED BY: Gianluca Gorni

Welcome to Wolfram Community! Please make sure you know the rules and how to format your code properly, which you can find here: https://wolfr.am/READ-1ST If you do not format code, it may become corrupted and useless to other members. Please EDIT your posts and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

POSTED BY: EDITORIAL BOARD
Posted 9 years ago

Gianluca: Thank you for your reply. I tried using your suggestion with the following result: Linear Combination Corrected

Your suggestion is: Graphics[Table[ Arrow[{{0, 0}, s {2, 4}, (1 - s) {4, 2}}], {s, 0, 1, 0.025}]]

However, following the "{0,0}," there will need to be a curly brace preceding "s {2, 4}, (1 - s) {4, 2}" because it is the vector used to create the arrow: Graphics[Table[Arrow[{{0, 0}, {s {2, 4}, (1 - s) {4, 2}}], {s, 0, 1, 0.025}]] -- It seems that the curly braces are required because the Arrow operator requires curly braces and the creation of a vector also requires curly braces, (resulting in a pile-up of curly braces): {Graphics[{Arrow[{{0, 0}, {2, 4}}], Arrow[{{0, 0}, {4, 2}}]}, Axes -> True], Graphics[Table[ Arrow[{{0, 0}, {{s {2, 4}, (1 - s) {4, 2}}}}], {s, 0, 1, 0.025}] , Axes -> True]} This again results in a non-result....corrected by carrying out the arithmetic.

POSTED BY: Arthur Hill

I think you should remove the extra curly braces:

Graphics[Table[
  Arrow[{{0, 0}, s {2, 4}, (1 - s) {4, 2}}], {s, 0, 1, 0.025}]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard