8,052 reputation
11949
bio website
location
age
visits member for 2 years, 9 months
seen 6 hours ago

9h
comment How to make hollow octahedron 3-compound?
I was sure this was a duplicate of an older question, but it's actually not...
18h
comment Implement a piecewise function elegantly and efficiently
I believe your function is also equivalent to Clip[0.5 x, {Max[xmin, x - m], Min[1, x + m]}].
19h
comment Mystifying failure of NonlinearModelFit
Providing a ballpark initial guess works for me: NonlinearModelFit[ts, a Exp[b t], {a, {b, 1/800}}, t]. Doesn't work with Method -> "NMinimize" though, which ignores it.
20h
comment Implement a piecewise function elegantly and efficiently
You can use Piecewise, which is designed to match the syntax of the mathematical definition-by-cases you wrote above. Although I don't know if there is any difference in performance.
1d
comment How to plot curves in ternary plot (triangular plot)
Indeed, I believe István Zachar's answer in particular would work perfectly for this question.
1d
comment How to check if a line segment intersects with a polygon?
Oh, yes it does. By "as expected" I meant "as in your answer". Yes, it does look like a bug. RegionDimension correctly returns 1, though.
1d
comment How to check if a line segment intersects with a polygon?
Wait, no, now everything is working as expected. And I was sure I restarted the kernel and checked, too... Maybe I made a mistake somewhere. Sorry for the confusion.
1d
comment How to check if a line segment intersects with a polygon?
Strange, I get True for all cases, even the ones that don't intersect. Which makes sense to me: an empty region is still a region, just like an empty set/list/graph is still a set/list/graph. (v10.0.1 on Mac, by the way)
1d
answered How to check if a line segment intersects with a polygon?
1d
comment How to check if a line segment intersects with a polygon?
By "a segment bounding the polygon" Daniel means a line segment on the boundary of the polygon, i.e., an edge of the polygon. The short red line does not intersect any of your polygon's ten edges.
1d
comment How to check if a line segment intersects with a polygon?
@novice: No, Daniel's method still works with nonconvex polygons. Do you have a counterexample in mind?
1d
revised Visualizing subgraphs while specifying the locations of vertexes
added 20 characters in body
1d
reviewed Close timing series algorithm
1d
reviewed Close Maxwell propagator problem 2D
1d
comment How to make the 3D borders like these around Notebook content?
@Sjoerd: I believe the OP wants the dark border above and to the left of the white notebook contents, which is missing in the second screenshot. Though I wonder how the OP took the first image showing what they want, given that they do not have it. :)
1d
reviewed Close A counterintuitive RegionPlot behavior
1d
comment How to simulate the 2-D motion of a particle under uniformly accelerated motion?
Can you explain what you mean by "simulate the motion"?
1d
comment RegionFunction generalized to plot a different colour/style for the largest expression
I do kind of want to hear that aside, but I'll understand if you're not inclined to typing it all up!
1d
comment RegionFunction generalized to plot a different colour/style for the largest expression
Are the questions different? "I have several functions of two variables defined in some region ... I'd like a plot to show at a glance the regions where each function is largest, with a different colour or similar" perfectly describes the other question (except for "smallest" vs. "largest").
1d
comment RegionFunction generalized to plot a different colour/style for the largest expression
Is this question "closely related" or an actual duplicate of the one you linked to? It certainly looks like a duplicate to me, but I haven't voted to close yet in case I'm missing something.