Sorry for terrible picture but lets say we have a unit vector A and we have vectors B and C. So for vector B I would want to rotate in a positive direction because the vector is "above A" and for vector C i would want to rotate downwards. Is there an easy way of detecting which way to rotate?
Vec2 a, b; // some random vector Vec2 cross = a.Cross(b); RelativeDirection(a,b,cross); // return true if the direction of                               // rotating a to b is counter-clockwise   How do I implement the function RelativeDirection()?  I got some suedo code from the textbook:  if a.Cross(b) &gt; 0 then ... else ...   but the cross product is a vector right? how do you compare it with an integer?
What is the best collation to use for MySQL with PHP? Is floating point math broken? Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen? Extra "lines" are being added when creating/editing questions/answers in Edge Lately, I've noticed that extra lines are being added when I create questions/answers. For example, if I write:   Your problem is X, Y, Z. Fix it by doing:      Code  Then maybe also do some other thing.  Oh, and some other thing as well.   When I post it, then go back into the editor, it's been changed to:   Your problem is X, Y, Z. Fix it by doing:       Code   Then maybe also do some other thing.   Oh, and some other thing as well.   Which is mildly annoying since that causes less to be displayed in the box at once, but whatever.  The weird thing is though, the added line isn't properly treated as a newline, even though it does appear to be caused by a newline. A lot of lines that look like they should be empty don't even get rendered. If I delete the original lines that I entered leaving only the "new" newlines, I get weird behavior:    I tried selecting the characters involved and inspecting them in Python, and they just appear to be newlines, so I have no idea what the problem is.    The only browser I've been able to reproduce it in is Edge (version 44.18362.329.0). It does not happen in Chrome. This has been happening for ~3 days now.    There is also a problem with link embedding and code formatting. If while editing I highlight some text and either try to embed a link (interlinked circle button) or format it as code ({} button), it often puts the wrong text between the […]s when embedding, or formats code that I didn't highlight (and doesn't format the code that I did highlight). In many experiments in quantum mechanics, a single photon is sent to a mirror which it passes through or bounces off with 50% probability, then the same for some more similar mirrors, and at the end we get interference between the various paths. This is fairly easy to observe in the laboratory.  The interference means there is no which-path information stored anywhere in the mirrors. The mirrors are made of 10^20-something atoms, they aren't necessarily ultra-pure crystals, and they're at room temperature. Nonetheless, they act on the photons as very simple unitary operators. Why is it that the mirrors retain no or very little trace of the photon's path, so that very little decoherence occurs?  In general, how do I look at a physical situation and predict when there will be enough noisy interaction with the environment for a quantum state to decohere? Can I enable the Windows 7 Start menu in Windows 10? I've upgraded from Windows 7 to Windows 10 and now I only find this new slower Start menu with all the tiles in it   (picturesource: )  Can I enable the older Windows 7 one again which suites my needs more? An example:    O  O?   There is a triple letter tile to the right of the bottom O, indicated with a ?.  If I place an X on it, making the words OX (vertical) and OX (horizontal), do I score 50 points (scoring the tile twice) or 34 (scoring it once)? Why Re-throw Exceptions? I've seen the following code many times:  try {     ... // some code } catch (Exception ex) {     ... // Do something     throw new CustomException(ex);      // or     // throw;      // or     // throw ex; }   Can you please explain the purpose of re-throwing an exception? Is it following a pattern/best practice in exception handling? (I've read somewhere that it's called "Caller Inform" pattern?) The  page indicates "the hats get put back in their boxes on January 4th". Aside from the pure terror that sentence seems to invoke, I was curious of exactly when this is going to be.  I know that the hats have caused a bit of a time warp at times (for example the starred chat hats). Will this be true of the removal process as well?  Do we get our hats until 23:39 UTC Jan 4th, are they removed at the end of UTC Jan 3rd? In a semiconductor memory chip, each bit of binary data is stored in a tiny circuit called a memory cell consisting of one to several transistors. Volatile type.   Suppose an application stored its data in a particular segment on the computers RAM.  How would the CPU know what data to extract and how would it sort through the other data to get to it. If everything in its core level is 0 or 1 its hard to distinguish what purpose 'x' memory has. How to show that there is an element of order $51$ in the multiplicative group $(Z/103Z)^∗.$  I can't use Cauchy's theorem since $51$ is not prime. Book series with college students finding a way to open portals to other planets I got the storyline of this book series (I believe it was a series) told to me by a colleague at a former workplace but I can't remember the name of the author or of any of the books in the series. The first book is about a couple of college students who find a way to relatively easily open portals to pretty much wherever they want to go. One day, NASA(?) finally succeeds in sending astronauts to Mars(?). When they have just left the spaceship, one of them suddenly gets a tap on the shoulder, and when he/she turns around, these college students stand there in their homemade space suits, chuckling. I believe these students later also start a company that helps other organizations establish themselves on other planets, or perhaps even &quot;conquers&quot; and sells planets to other organizations. A later book in the series also describes a system that lets people upload their minds to the cloud. Some people choose to live solely in the cloud as virtual creatures, only deciding to &quot;descend&quot; into a &quot;flesh&quot; body when they need to perform some task that requires them to be in physical form. Some people also choose to live in physical form but as several entities, or clones, and sync their mind between the clones through this system, basically allowing them to, for example, run a one-man company with several &quot;instances&quot; of the same human who all share their knowledge and all know exactly what all other clones know in the same moment, effectively creating a super-efficient team of workers. Can I talk to the blue alpaca? Reese's boyfriend seems to constantly be asleep. When I try and talk to him, she warns me that he's been hard at work all night, but I can't actually enter the shop at night.   Is there any way to talk to him or any benefit for doing so? I've tried to talk to him daily for a week (thinking it was something akin to talking to Sable) but I've had no luck. Trying to come in after-hours doesn't work. Group algebra ever a field? Let $G$ be a group. Let $K$ be any field and consider its group algebra $K[G]$. It is known that if $G$ is a finite group then $K[G]$ is never a field. Or even if $G$ is not finite: if $G$ has at least one non-trivial torsion element, then $K[G]$ is not a field.  Question: Do there exist infinite groups $G$ such that $K[G]$ is a field or a division ring? Assume that $f(x),g(x)$ are positive and are in $L^1$. Moreover, they are differentiable and their derivative is integrable. Let $h(x)=f(x)*g(x)$, the convolution of $f$ and $g$. Does the derivative of $h(x)$ exist? If yes, how can we prove that $$ \frac{d}{dx}(f(x)*g(x)) = \left(\frac{d}{dx}f(x)\right)*g(x)$$  Thanks How can I upgrade to Java 1.8 on an Amazon Linux Server? I tried sudo yum update but it just keeps java "1.7.0_75". I need 1.8 for it to work with another application but can't figure out how to upgrade it. Do I need to manually install it somehow? There's not much information on this on the internet as far as I can see. Specs:   java version "1.7.0_75" OpenJDK Runtime Environment (amzn-2.5.4.0.53.amzn1-x86_64 u75-b13) OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)   When I try update now:     [ec2-________]$ sudo yum update Loaded plugins: priorities, update-motd, upgrade-helper amzn-main/latest                                         | 2.1 kB     00:00 amzn-updates/latest                                      | 2.3 kB     00:00 No packages marked for update   Is there anything else I need to do? Thanks. I have this statement and I need to say if it is true or false:  Let $\{a_n\}$ be a real sequence.  $$\lim_{n\to +\infty} a_n = 0 \quad \implies \quad \sum_{n=1}^{\infty}(-1)^na_n \quad \text{converges}$$  I know, from the Leibniz criterion that:     If $a_n \to 0$, $a_n$ is decreasing and positive then $\sum_{n=1}^{\infty}(-1)^na_n$ converges   From this fact I believe that the statement is false but I couldn't come up with an infinitesimal sequence that isn't decreasing and for that reason is divergent. I tried some function with $sin(\frac{1}{n})$ without any luck. Any help would be very appreciated, thank you! How to simulate slow internet connections on the mac What's a good software solution to slow down internet connections on the mac for testing and simulations?  My primary need is when testing code in the iPhone / iOS simulator, so slowing down the connection for specific applications or processes would be great. Opening Raster stored in Esri Geodatabase using QGIS Is there a way to open a raster that is stored in ESRI V10.0 Geodatabase in QGIS V2.4?    I can open the vector layer, but there does not seems to be a way to open a raster. Question about Angle-Preserving Operators This an exercise out of Spivak's "Calculus on Manifolds".  Edit:  There was a typo in the exercise as is noted below in the answers.  The statement has been edited to reflect this.  Given $x,y\in\mathbb{R}^{n}$, the angle between $x$ and $y$ is defined by  $$\angle(x,y) = \arccos\left(\frac{\langle x,y \rangle}{|x|\cdot |y|}\right),$$ where $\langle x,y \rangle$ denotes the standard Euclidean inner product.  A linear operator $T:\mathbb{R}^{n}\to\mathbb{R}^{n}$ is said to be angle-preserving if $\angle(T(x),T(y)) = \angle(x,y)$ for every $x,y\in\mathbb{R}^{n}$.  The exercise as stated:  Let $\{x_{1},\dots, x_{n}\}$ be a basis for $\mathbb{R}^{n}$.  Then suppose that $\lambda_{1}, \dots, \lambda_{n}\in \mathbb{R}$ are such that $Tx_{j} = \lambda_{j}x_{j}$ for each $j = 1,\dots, n$.  Then $T$ is angle-preserving only if (not if and only if!)$|\lambda_{i}| = |\lambda_{j}|$ for every $1\leq i\leq j\leq n$.  I'm having problems with the $(\Rightarrow)$ direction.  My best attempt (which seems to lead nowhere) is to suppose that $|\lambda_{j}|\neq |\lambda_{k}|$.  Then by assumption, \begin{align*} \angle(Tx_{j},Tx_{k}) &amp; = \arccos\left(\frac{\langle Tx_{j},Tx_{k} \rangle}{|Tx_{j}|\cdot |Tx_{k}|}\right)\\ &amp; = \arccos\left(\frac{\langle \lambda_{j}{x_{j}},\lambda_{k}{x_{k}} \rangle}{|\lambda_{j}{x_{j}}|\cdot |\lambda_{k}{x_{k}}|}\right)\\ &amp; = \arccos\left(\frac{\lambda_{j}\lambda_{k}\langle {x_{j}},{x_{k}} \rangle}{|\lambda_{j}|\cdot|\lambda_{k}|\cdot|{x_{j}}|\cdot |{x_{k}}|}\right)\\ &amp; = \arccos\left(\text{sign}(\lambda_{j})\text{sign}(\lambda_{k})\frac{\langle {x_{j}},{x_{k}} \rangle }{|{x_{j}}|\cdot |{x_{k}}|}\right)\\ \end{align*} may also be calculated as \begin{align*} \angle(Tx_{j},Tx_{k}) &amp; =  \angle(x_{j},x_{k})\\ &amp; = \arccos\left(\frac{\langle x_{j},x_{k} \rangle}{|x_{j}|\cdot |x_{k}|}\right). \end{align*}  Then since $\arccos$ is injective, I believe I can make the jump that $\text{sign}(\lambda_{j})\text{sign}(\lambda_{k}) = 1$, which does not resemble the conclusion that I should arrive at.  Note:  I wasn't sure what tag to put this under, so anyone who knows better please feel free to adjust.  Thanks for any help you can give. Why can bases of number systems not be rational numbers? This is a question that keeps bothering me: much of mathematics was created by extending rules to new domains e.g. negative numbers were created by consistently extending arithmetic beyond positive integers. However, with number bases it seems impossible to do this. Number bases are integers, but could they be rational numbers? I've had previous discussions about this, see . One problem can be seen with this example: in base 2.5, 0.22 is greater than one. That's not what we want! What, if anything, can be done about this?  EDIT: To put it another way - if every positional number is less than any digit to its left, why doesn't this apply to fractional base positional numbers?