Place two-dimensional Graphics object into three-dimensional Graphics3D object

I have a labelled two-dimensional Polygon that I render with Graphics.

label = {RGBColor[1., 0.92, 0.61], Polygon[{{0, 0}, {4, 0}, {4, -1}, {0, -1}}]}; label = Graphics[{labels, Inset[Text["Some Label", BaseStyle -> {FontSize -> 40}], (1/2) {4, -1}]}]; 

Picture of the 2D labelled graphics

I want to place this object in a three-dimensional Graphics3D, such that the text also gets projected into the plane. So I want an image that looks like the following but with the code modified so that the text is also present

labels = {RGBColor[1., 0.92, 0.61], Polygon[{{0, 0, 0}, {4, 0, 0}, {4, -1, 0}, {0, -1, 0}}]}; object = {Blue, Cuboid[{0, 0, 0}, {4, 2, 3}]}; Graphics3D[{object, labels}, Boxed -> False] 

Picture of 3D graphics with cuboid object and 'label' (but missing text)

Is it possible to get the coordinates only for the Highlighted points from an image?

I would like to ask you if it is possible to get the coordinates or a couple of numbers that can give me the positions of the highlights points in an image. I know that there is the possibility to select “get coordinates” by clicking on the image, but what I am looking for something that can automate the selection/generation of the points and can remove the image once selected the highlights.

Any suggestion will be welcomed.

How to generated random waves

I want to generate a set of $ N$ random waves, where the wave vector and phase are random numbers, this is my code

 `Nwaves = 3;    theta := 2*Pi*RandomReal[];   phi := ArcCos@RandomReal[{-1, 1}] ; alpha :=  RandomReal[{0, 1}]; u = Sum[ Sin[ Cos[theta] Sin[phi]  x +  Sin[theta] Sin[phi]  y  +        Cos[theta] z + alpha], {Nwaves}] v = Sum[-Cos[ Cos[theta] Sin[phi]  x +  Sin[theta] Sin[phi]  y  +        Cos[theta] z + alpha], {Nwaves}]`  

This code changes the parameters for each N. And the problem needs to have the same values for cosine, sine, and alpha. And after each iteration they have to change as N varies.

Solar Power Calculations

Good Afternoon, I have calculated the Incident beam radiation for a given locations local sunlight hours.

Rise = Sunrise[GeoPosition[{57.7053, -3.33917}],     DateRange[DateObject[{2019, 1, 1}], DateObject[{2019, 12, 31}]]]; Sunrises = DateString[#, {"Hour", "Minute"}] & /@ Rise["Values"] Sets = Sunset[GeoPosition[{57.7053, -3.33917}],     DateRange[DateObject[{2019, 1, 1}], DateObject[{2019, 12, 31}]]]; Sunsets = DateString[#, {"Hour", "Minute"}] & /@ Sets["Values"];   Sunrises[[1]] Sunsets[[1]]  n = Table[0 + i, {i, 1, 1}];(*Days of the Year*)  LSH = Table[i + 0.01, {i, 8.93, 15.616667, 0.01}]; (*Local Solar Hour*) H = 360/24*(LSH - 12);(*Hour Angle*) L = 57.7053;(*Latitude*)  \[Delta] =   23.45*Sin[360/365*(n - 81) Degree](*Solar Declination of the sun*);  \[Beta] = (Cos[L Degree]*Cos[First[\[Delta]] Degree ]*  Cos[H Degree ]) + ((Sin[L Degree]*Sin[First[\[Delta]] Degree]));  Arc\[Beta] = ArcSin[\[Beta] ]*180/Pi; A = 1160 + 75 Sin[360/365*(n - 275) Degree](*Extraterrestial Flux*);  m = 1/(Sin[  Arc\[Beta] Degree])(*Air Mass Ratio for every hour of the day*); k = 0.174 + 0.035*Sin[360/365*(n - 100) Degree];(*Optical Depth*)  IB = First[A]*E^(-First[k]*m); (*Direct Beam radiation Wm^-2*) test = Transpose[{LSH, IB}];  ListLinePlot[test, PlotRange -> {{8.5, 16}, {0, 600}}] 

From the ListLinePlot, it should show solar radiation for the daylight hours of the location. Where sunrise is 0856 and sunset is 1537 (Considering time of year) However the graph shows a sudden increase before the given sunset time where the graph should have a bell shape resemblence between 0856 and 1537(8.933333 and 15.616667 in numerical format) I’ve been going over this code for days trying to solve this so any help would be appreciated.

Luke

Why is Manipulation not creating a graph?

Why does manipulation not give a graph?

Remove[y]; Remove[b]; n = 1; k = 1; j = Solve[k*y*(1 - y/n) - b == 0, {y}] o[b_] := Evaluate[y /. j] s = DSolve[y'[t] == k*y[t]*(1 - y[t]/n) - b, y[t], t]; f[t_, b_, c_] := Evaluate[y[t] /. s] sol = Table[f[t, b, c], {c, -5, 5}] d=Manipulate[Plot[sol, {t, -5, 5}], {b, 1, 5}] 

Image

How do we correct this? How would I turn this into a gif?

Writing to ElasticSearch

Could someone kindly direct me to suitable documentation, Wolfram or otherwise, to connect Mathematica to an ElasticSearch instance. I don’t need anything complicated just sufficient to write a record of two numbers and a space separated string which will need tokenising. An improvement would be if I could write out a list of such, around 100mb in size, in one call to ElasticSearch.

TIA

An Elementary Introduction – Problem 22.13 VertexLabels [duplicate]

This question already has an answer here:

  • Bug in NearestNeighborGraph 2 answers

Problem 22.13

Make raster images of the letters of the alphabet at size 20, then make a graph of the 2 nearest neighbors of each one.

My solution

NearestNeighborGraph[ Rasterize[#, RasterSize -> 20] & /@ Alphabet[], 2, VertexLabels -> All]

The output

enter image description here

I actually visited the solutions page and ran that code with a similar result. Many of my students are getting the same thing. Any ideas?

Simplify a series expansion including Trigonometric expressions

I have an expression like:

Maf P \[Omega]m Sin[P t \[Omega]m] ((3 Vm)/(\[Pi] R) + \!\( \*UnderoverscriptBox[\(\[Sum]\), \(k = 1\), \(n\)]\(- \*FractionBox[\(6\  \*SuperscriptBox[\((\(-1\))\), \(k\)]\ Vm\ Cos[     k\ p\ t\ w]\), \(\((\(-\[Pi]\) + 36\  \*SuperscriptBox[\(k\), \(2\)]\ \[Pi])\)\  \*SqrtBox[\( \*SuperscriptBox[\(R\), \(2\)] +  \*SuperscriptBox[\(k\), \(2\)]\  \*SuperscriptBox[\(L\), \(2\)]\  \*SuperscriptBox[\(p\), \(2\)]\  \*SuperscriptBox[\(w\), \(2\)]\)]\)]\)\)) 

and I like to expressions like Sin[k p t w + P t [Omega]m] and Sin[k p t w – P t [Omega]m] automatically

Repeat elements in list, but the number of times each element is repeated is provided by a separate list

I’m trying to repeat each element of a list x number of times, where x is the corresponding element of the same position in another list.

For example, I have list A = {1,2,3,4} and another list B = {3,1,4,2} and I’m trying to get C = {1,1,1,2,3,3,3,3,4,4}.

How do I get C from A and B?

Thanks.

Does such prime $P$ exist?

The equation $ (10^{6n+1}-54n-10)($ mod P$ ) = 0$ , find the value of prime P such that there are AT LEAST 3 solutions for n > 0 , whose values of n are all below (P-1)/6. I don’t even know how to solve this using W Alpha , but I used this strategy : Find a prime P such that $ 10^{6n+1}$ (mod P) and $ (54n+10)$ (mod P) both give the same residues. But this strategy is very inefficient and wasting times . Could you help me to find such prime P ?. Does such prime P exist?