如何在飞机上有效地分配点(How to effectively distribute points on plane)
我有一个宽度和高度的平面(屏幕)(显示器分辨率,而不是方形)。 我想在相同距离(大致)相同的距离上分配飞机上的点数。
例如:
- 1分将在中间,
- 2点将位于y轴的中间,x轴将被3分割
- 3个点可能像三角形,但如果它足够宽,则可以在相同的y中对齐
- 4像上面的第二部分,或作为矩形..
- 最多8点
有没有任何算法?
感谢您的时间!
编辑:相互之间和平面边界的距离相同
编辑2:我计算我在飞机上模拟行为的物体组的质量中心。
I have a plane (screen) with its width and height (monitor resolution, not square). And I'd like to distribute points on that plane with the (approximately) same distance from each other.
For example:
- 1 point will be in the middle,
- 2 points will be in the middle of y axis, and x axis will be divided by 3
- 3 points may be like triangle, but if sceen is wide enough, thay can be alighned in same y
- 4 like second part of above, or as rectangle..
- etc to 8 points max
Is there any algorithm for this?
Thank you for your time!
EDIT: same distance from each other and from plane border
EDIT2: I compute centers of mass for groups of objects on which behavior I simulate on plane.
原文:https://stackoverflow.com/questions/15198959
最满意答案
我认为我应该回应我自己的问题,至少这是一个结案。
经过一些更深入的挖掘,并从我收到的评论中,最终结果是gnuplot
postscript
终端不处理透明度,而pdfcairo
终端则处理透明度。诀窍是使用
pdftops
从.pdf生成一个.eps文件:#!/bin/bash gnuplot << GNU set term pdf set out "out.pdf" plot "<jot -r -p 2 500 1 2" not w p pt 7 ps 4 lc rgb "#908DB6CD" GNU pdftops -eps out.pdf
生成的所有.eps文件都将被合并到LaTeX文档中。 然后,我可以切换到PDFLaTeX并结束它。 但是,有时我喜欢编辑.eps来手动或使用awk / sed来调整边界框和其他东西。 无论如何,希望这是有帮助的。
I think I should respond to my own question, so at least this becomes a case closed.
After some more digging, and from the comments I received, the bottom line is that the gnuplot
postscript
terminal does not handle transparency, while thepdfcairo
terminals do.The trick is to generate an .eps file from a .pdf using
pdftops
:#!/bin/bash gnuplot << GNU set term pdf set out "out.pdf" plot "<jot -r -p 2 500 1 2" not w p pt 7 ps 4 lc rgb "#908DB6CD" GNU pdftops -eps out.pdf
All of my .eps files are generated to be incorporated to LaTeX documents. Then, I could just switch to PDFLaTeX and be over with it. However, at times I like to edit the .eps to tweak the bounding box and other things by hand or using awk/sed. Anyway, hope this is helpful.
相关问答
更多-
我在这里找到了答案。 基本上gnuplot需要重新安装为: brew reinstall gnuplot --with-x11 此页面还有助于解决Mavericks上的Octave安装问题。 I found the answer here. Basically gnuplot needs to be reinstalled as: brew reinstall gnuplot --with-x11 This page also helps with troubleshooting Octave inst ...
-
我不确定,真正的错误是什么,但它似乎与你使用using "PHEAT":"RHOT" ,虽然这应该没问题。 我可以使用以下最小设置重现您的错误: 一个数据文件test.dat : A B 1 2 2 3 3 4 和一个文件test.gp : f(x) = a*x**2 + b*x + c fit f(x) 'test.dat' using "A":"B" via a,b,c 如果我用gnuplot test.gp调用此文件,我会得到与您相同的错误。 如果我使用using 1:2 ,则不会出现。 如果我 ...
-
gnuplot postscript终端不显示透明符号(gnuplot postscript terminal not showing transparent symbols)[2021-12-31]
我认为我应该回应我自己的问题,至少这是一个结案。 经过一些更深入的挖掘,并从我收到的评论中,最终结果是gnuplot postscript终端不处理透明度,而pdf和pdfcairo终端则处理透明度。 诀窍是使用pdftops从.pdf生成一个.eps文件: #!/bin/bash gnuplot << GNU set term pdf set out "out.pdf" plot "当我将终端更改为png (或pdf或pdfcairo )(例如set term png enhanced )时,我得到一个看起来正确的图。 然而,gnuplot似乎认为postscript应该创建一个透明的情节(见下表,摘自help transparent )。 所以,我的诊断是它是gnuplot中的错误,或文档中的错误。 terminal solid pattern pm3d -------------------------------- gif no ...gnuplot中的星形符号(star symbols in gnuplot)[2022-06-25]
set term postscript enh color eps set output 'test.eps' set title 'star1:{/ZapfDingbats \110} star2:{/ZapfDingbats \111}' plot sin(x) 看一下gnuplot发行版附带的docs/psdoc/ps_guide.ps 。 这是我在寻找特殊的后记人物时去的地方...... set term postscript enh color eps set output 'test.eps' ...根据这个答案: https : //stackoverflow.com/a/16358393/1134387,有比Gnuplot中test显示的少数符号更多的符号。 当使用64,65和66作为点pointtype ,我得到没有内部点的符号,这有效地解决了我的问题。 According to this answer: https://stackoverflow.com/a/16358393/1134387 there are much more symbols than the few shown by te ...你问了postscript ,它给了你PostScript 。 像这样的终端只是以适当的格式写出输出,并且gnuplot不应该给出一个图形窗口来显示它的外观。 您可以通过添加行将PostScript写入文件 set output "output.ps" 在绘图之前的某个地方,然后使用您最喜欢的PostScript文档阅读器查看文件output.ps 。 不生成图形窗口对批处理作业或脚本编写很有用。 例如,在撰写论文时,我通常会编写一个构建脚本来调用gnuplot来构建我的图.eps (或.pdf )--- ...许多终端支持增强的文本,而不仅仅是postscript终端。 为了使用除下标的/Symbol之外的其他字体,您可以明确地将字体更改为不同的字体。 但是,更好的方法是更改嵌套,以便/Symbol仅影响两个部分: set label 1 at 0,0 '{/=50{/Symbol \362}@_{/=15 350}^{/=15{/Symbol \154}_{/=10 average}}' front plot x 使用带有wxt的gnuplot 5.0输出 如果你epslatex使用postscript终端, ...Gnuplot范围为情节(Gnuplot ranges for plot)[2022-02-07]
命令set logscale x将完成这项工作。 set nokey set title "Dynamical dominance criteria example" set logscale x set logscale y set format y "10^{%T}" plot "lambda.dat" using 1:2 lc 0 pt 12, \ "lambda.dat" using 3:($2*3):4 with labels 对我来说,命令set xrange [0.1:100 ...gnuplot中的加/减符号?(Plus/minus symbol in gnuplot?)[2022-04-29]
仅仅是为了记录,从Gnuplot的角度来看,正确的答案似乎是这样的: set encoding iso_8859_1 set label "-56 \261 2" 这给了一个标签 -56 ± 2 它在不同的机器(相同的Gnuplot级别)上完美地工作,所以我不确定为什么在原始的Ubuntu机器上存在问题; 两台机器都正确显示生成的.eps文件。 Just for the record, from the Gnuplot perspective the correct answer does appe ...相关文章
更多- Ubuntu 12.04 Hadoop + HBase distribute
- Hadoop 详细配置步骤
- 如何在jbpm4.0中给任务分配执行人
- 就微信飞机大战设计的几点思考
- 微信5.0打飞机怎么取得高分?
- 使用OGEngine开发微信经典飞机大战
- 微信打飞机
- 微信飞机大战游戏开发
- 微信5.0打飞机怎么取得高分?
- 在Linux单机上运行Hadoop-0.20.0实例
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)